diff --git a/MODULE.bazel b/MODULE.bazel index 96c91a46f24e2..f94e31a64382d 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -83,8 +83,8 @@ git_override( build_file_content = "# empty", # We pin to specific upstream commits and try to track top-of-tree # reasonably closely rather than pinning to a specific release. - # HEAD as of 2026-06-28. - commit = "f3a69752ac184360afeb921d157ae08b89c2c091", + # HEAD as of 2026-07-07. + commit = "1a5376e062e3f3b99ffce25e24e53182202e06b9", patch_cmds = ["echo \"module(name='llvm-raw')\" > MODULE.bazel"], patch_strip = 1, patches = [ @@ -93,6 +93,7 @@ git_override( "//bazel/llvm_project:0004_Introduce_basic_sources_exporting_for_libunwind.patch", "//bazel/llvm_project:0005_Introduce_basic_sources_exporting_for_libcxx_and_libcxxabi.patch", "//bazel/llvm_project:0009_Introduce_starlark_exporting_compiler-rt_build_information.patch", + "//bazel/llvm_project:0010_Exclude_addtf3_cpp_from_compiler_rt_builtins.patch", ], remote = "https://github.com/llvm/llvm-project.git", ) diff --git a/bazel/llvm_project/0010_Exclude_addtf3_cpp_from_compiler_rt_builtins.patch b/bazel/llvm_project/0010_Exclude_addtf3_cpp_from_compiler_rt_builtins.patch new file mode 100644 index 0000000000000..e8ce2ac0f71b6 --- /dev/null +++ b/bazel/llvm_project/0010_Exclude_addtf3_cpp_from_compiler_rt_builtins.patch @@ -0,0 +1,44 @@ +From 71c318f73cdc3f2c5acd0383dbe057426fc3e5ab Mon Sep 17 00:00:00 2001 +From: Richard Smith +Date: Sat, 11 Jul 2026 00:07:36 +0000 +Subject: [PATCH] Exclude libc math C++ builtins from compiler-rt Bazel overlay + +In CMake, addtf3.cpp is only compiled when COMPILER_RT_USE_LIBC_MATH is ON, +replacing addtf3.c. In the Bazel overlay, builtins_generic_srcs globbed +all lib/builtins/*.cpp without excluding addtf3.cpp, causing compile failures +when not using libc math. + +Assisted-by: Gemini via Antigravity +--- + utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel +index ae4a99d6885c..afa726a14a5b 100644 +--- a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel ++++ b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel +@@ -293,6 +293,11 @@ filegroup( + srcs = glob(BUILTINS_MACOS_ATOMIC_SRCS_PATTERNS), + ) + ++BUILTINS_LIBC_MATH_EXCLUDES = [ ++ # Sources requiring COMPILER_RT_USE_LIBC_MATH (e.g. LIBC_NAMESPACE::shared::*). ++ "lib/builtins/addtf3.cpp", ++] ++ + # Source files for portable components of the compiler builtins library. + filegroup( + name = "builtins_generic_srcs", +@@ -309,7 +314,8 @@ filegroup( + BUILTINS_TF_EXCLUDES + + BUILTINS_TF_SRCS_PATTERNS + + BUILTINS_ATOMICS_SRCS + +- BUILTINS_MACOS_ATOMIC_SRCS_PATTERNS ++ BUILTINS_MACOS_ATOMIC_SRCS_PATTERNS + ++ BUILTINS_LIBC_MATH_EXCLUDES + ), + ), + ) +-- +2.55.0.795.g602f6c329a-goog + diff --git a/common/check_internal.cpp b/common/check_internal.cpp index f167187359479..95795ccca5a90 100644 --- a/common/check_internal.cpp +++ b/common/check_internal.cpp @@ -24,7 +24,7 @@ namespace { // our own type-erased version of `format` here. auto FormatvInto( llvm::raw_ostream& out, llvm::StringRef format_str, - llvm::ArrayRef adapters) -> void { + llvm::ArrayRef adapters) -> void { for (const llvm::ReplacementItem& replacement : llvm::formatv_object_base::parseFormatString(format_str, adapters.size(), /*Validate=*/true)) { @@ -33,7 +33,7 @@ auto FormatvInto( out << replacement.Spec; continue; } - llvm::FmtAlign(*adapters[replacement.Index], replacement.Where, + llvm::FmtAlign(adapters[replacement.Index], replacement.Where, replacement.Width, replacement.Pad) .format(out, replacement.Options); } @@ -43,7 +43,7 @@ auto FormatvInto( auto CheckFailImpl( const char* kind, const char* file, int line, const char* condition_str, const char* extra_format, - llvm::ArrayRef extra_adapters) + llvm::ArrayRef extra_adapters) -> void { // Render the final check string directly into one stream. The extra message // is rendered in place from its format string and type-erased adapters, so diff --git a/common/check_internal.h b/common/check_internal.h index a97a43259823b..408912abb7a1e 100644 --- a/common/check_internal.h +++ b/common/check_internal.h @@ -49,7 +49,7 @@ CheckCondition(bool condition) auto CheckFailImpl( const char* kind, const char* file, int line, const char* condition_str, const char* extra_format, - llvm::ArrayRef extra_adapters) + llvm::ArrayRef extra_adapters) -> void; // Allow custom conversion of format values; the default behaviour is to just @@ -74,21 +74,10 @@ auto ConvertFormatValue(T&& t) -> auto { } } -// Helper to compute a pointer to the base class of a given LLVM -// `format_adapter` object. This both handles converting to the base class and -// allows taking the address of temporaries within arguments to another function -// call. -template -auto CheckFailFormatAdapterAddr(T&& adapter) - -> llvm::support::detail::format_adapter* { - return &adapter; -} - -// Builds one type-erased format adapter per value -- forwarding each value -// through the conversion machinery. The address of the base classes of each of -// these are then collected into an init list that can be accessed with an -// `ArrayRef`. All of this is then passed to the out-of-line rendering function -// `CheckFailImpl`. +// Builds one type-erased format functor per value -- forwarding each value +// through the conversion machinery. References to each of these functors are +// then collected into an init list that can be accessed with an `ArrayRef`. All +// of this is then passed to the out-of-line rendering function `CheckFailImpl`. // // This is templated only on the value types, not on the per-check-site // metadata (file, line, etc., which are passed as ordinary arguments), so the @@ -101,10 +90,9 @@ template auto CheckFailFormat(const char* kind, const char* file, int line, const char* condition_str, const char* extra_format, Ts&&... values) -> void { - CheckFailImpl( - kind, file, line, condition_str, extra_format, - {CheckFailFormatAdapterAddr(llvm::support::detail::build_format_adapter( - ConvertFormatValue(std::forward(values))))...}); + CheckFailImpl(kind, file, line, condition_str, extra_format, + {llvm::support::detail::FormatFunctor( + ConvertFormatValue(std::forward(values)))...}); } // Prints a check failure, including rendering any user-provided message using diff --git a/toolchain/check/cpp/call.cpp b/toolchain/check/cpp/call.cpp index 525ddaf570c70..5547a4443b842 100644 --- a/toolchain/check/cpp/call.cpp +++ b/toolchain/check/cpp/call.cpp @@ -310,7 +310,7 @@ static auto BuildTemplateId(Context& context, SemIR::LocId loc_id, dyn_cast(template_decl)) { auto decl_result = context.clang_sema().CheckVarTemplateId( var_template_decl, /*TemplateLoc=*/clang::SourceLocation(), loc, - arg_list, /*SetWrittenArgs=*/false); + arg_list); return decl_result.isInvalid() ? SemIR::ErrorInst::InstId : ImportCppDecl(context, loc_id, diff --git a/toolchain/check/cpp/export.cpp b/toolchain/check/cpp/export.cpp index 7b22bd44ef8af..eb76dce54b364 100644 --- a/toolchain/check/cpp/export.cpp +++ b/toolchain/check/cpp/export.cpp @@ -869,8 +869,11 @@ auto ExportFunctionSpecializationToCpp( auto* template_arg_list = clang::TemplateArgumentList::CreateCopy( context.ast_context(), template_args); function_decl->setFunctionTemplateSpecialization( - function_template_decl, template_arg_list, - /*InsertPos=*/nullptr, clang::TSK_ExplicitSpecialization); + context.ast_context(), function_template_decl, template_arg_list, + /*InsertPos=*/nullptr, clang::TSK_ExplicitSpecialization, + /*TemplateParams=*/nullptr, /*TemplateArgsAsWritten=*/nullptr, + /*PointOfInstantiation=*/clang::SourceLocation(), + /*AddSpecialization=*/true); return true; } diff --git a/toolchain/driver/testdata/compile/optimize/clang_no_optimize_twice.carbon b/toolchain/driver/testdata/compile/optimize/clang_no_optimize_twice.carbon index 155be27ca7e61..5ab3e5cb4d6ef 100644 --- a/toolchain/driver/testdata/compile/optimize/clang_no_optimize_twice.carbon +++ b/toolchain/driver/testdata/compile/optimize/clang_no_optimize_twice.carbon @@ -48,10 +48,10 @@ fn Call() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: noinline nounwind optnone -// CHECK:STDOUT: define i32 @_CCall.Main() #2 !dbg !11 { +// CHECK:STDOUT: define i32 @_CCall.Main() #2 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %g.call = call i32 @_Z1gv(), !dbg !15 -// CHECK:STDOUT: ret i32 %g.call, !dbg !16 +// CHECK:STDOUT: %g.call = call i32 @_Z1gv(), !dbg !16 +// CHECK:STDOUT: ret i32 %g.call, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -69,14 +69,15 @@ fn Call() -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 12, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DILocation(line: 13, column: 10, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 13, column: 3, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 12, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DILocation(line: 13, column: 10, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 13, column: 3, scope: !12) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/builtins/cpp.carbon b/toolchain/lower/testdata/builtins/cpp.carbon index fd7972d24c35c..f404afb2cf071 100644 --- a/toolchain/lower/testdata/builtins/cpp.carbon +++ b/toolchain/lower/testdata/builtins/cpp.carbon @@ -53,49 +53,49 @@ fn Test() { // CHECK:STDOUT: declare void @_CTakePointerSize.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTest.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CTest.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc25_53.1.temp = alloca [16 x i8], align 8, !dbg !14 -// CHECK:STDOUT: %.loc25_52.3.temp = alloca [4 x i32], align 4, !dbg !15 -// CHECK:STDOUT: %.loc26_47.1.temp = alloca [16 x i8], align 8, !dbg !16 -// CHECK:STDOUT: %.loc26_46.3.temp = alloca [4 x i32], align 4, !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_53.1.temp), !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_52.3.temp), !dbg !15 -// CHECK:STDOUT: %.loc25_52.4.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 0, !dbg !15 -// CHECK:STDOUT: %.loc25_52.7.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 1, !dbg !15 -// CHECK:STDOUT: %.loc25_52.10.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 2, !dbg !15 -// CHECK:STDOUT: %.loc25_52.13.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 3, !dbg !15 -// CHECK:STDOUT: %MakePointerPointer.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc25_53.1.temp, i32 0, i32 0, !dbg !14 -// CHECK:STDOUT: store ptr @array.loc25_52.18, ptr %MakePointerPointer.call.init_list.begin, align 8, !dbg !14 -// CHECK:STDOUT: %MakePointerPointer.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc25_53.1.temp, i32 0, i32 8, !dbg !14 -// CHECK:STDOUT: store ptr getelementptr inbounds ([4 x i32], ptr @array.loc25_52.18, i32 1), ptr %MakePointerPointer.call.init_list.end, align 8, !dbg !14 -// CHECK:STDOUT: call void @_CTakePointerPointer.Main(ptr %.loc25_53.1.temp), !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_47.1.temp), !dbg !16 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_46.3.temp), !dbg !17 -// CHECK:STDOUT: %.loc26_46.4.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 0, !dbg !17 -// CHECK:STDOUT: %.loc26_46.7.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 1, !dbg !17 -// CHECK:STDOUT: %.loc26_46.10.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 2, !dbg !17 -// CHECK:STDOUT: %.loc26_46.13.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 3, !dbg !17 -// CHECK:STDOUT: %MakePointerSize.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc26_47.1.temp, i32 0, i32 0, !dbg !16 -// CHECK:STDOUT: store ptr @array.loc25_52.18, ptr %MakePointerSize.call.init_list.begin, align 8, !dbg !16 -// CHECK:STDOUT: %MakePointerSize.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc26_47.1.temp, i32 0, i32 8, !dbg !16 -// CHECK:STDOUT: store i64 4, ptr %MakePointerSize.call.init_list.size, align 8, !dbg !16 -// CHECK:STDOUT: call void @_CTakePointerSize.Main(ptr %.loc26_47.1.temp), !dbg !19 -// CHECK:STDOUT: call void @"_COp.8ab5ebc4f407c395:core.Destroy.Core"(ptr @array), !dbg !17 -// CHECK:STDOUT: call void @"_COp.8ab5ebc4f407c395:core.Destroy.Core"(ptr @array), !dbg !15 -// CHECK:STDOUT: ret void, !dbg !20 +// CHECK:STDOUT: %.loc25_53.1.temp = alloca [16 x i8], align 8, !dbg !15 +// CHECK:STDOUT: %.loc25_52.3.temp = alloca [4 x i32], align 4, !dbg !16 +// CHECK:STDOUT: %.loc26_47.1.temp = alloca [16 x i8], align 8, !dbg !17 +// CHECK:STDOUT: %.loc26_46.3.temp = alloca [4 x i32], align 4, !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_53.1.temp), !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_52.3.temp), !dbg !16 +// CHECK:STDOUT: %.loc25_52.4.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 0, !dbg !16 +// CHECK:STDOUT: %.loc25_52.7.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 1, !dbg !16 +// CHECK:STDOUT: %.loc25_52.10.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 2, !dbg !16 +// CHECK:STDOUT: %.loc25_52.13.array.index = getelementptr inbounds [4 x i32], ptr %.loc25_52.3.temp, i32 0, i64 3, !dbg !16 +// CHECK:STDOUT: %MakePointerPointer.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc25_53.1.temp, i32 0, i32 0, !dbg !15 +// CHECK:STDOUT: store ptr @array.loc25_52.18, ptr %MakePointerPointer.call.init_list.begin, align 8, !dbg !15 +// CHECK:STDOUT: %MakePointerPointer.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc25_53.1.temp, i32 0, i32 8, !dbg !15 +// CHECK:STDOUT: store ptr getelementptr inbounds ([4 x i32], ptr @array.loc25_52.18, i32 1), ptr %MakePointerPointer.call.init_list.end, align 8, !dbg !15 +// CHECK:STDOUT: call void @_CTakePointerPointer.Main(ptr %.loc25_53.1.temp), !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_47.1.temp), !dbg !17 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_46.3.temp), !dbg !18 +// CHECK:STDOUT: %.loc26_46.4.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 0, !dbg !18 +// CHECK:STDOUT: %.loc26_46.7.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 1, !dbg !18 +// CHECK:STDOUT: %.loc26_46.10.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 2, !dbg !18 +// CHECK:STDOUT: %.loc26_46.13.array.index = getelementptr inbounds [4 x i32], ptr %.loc26_46.3.temp, i32 0, i64 3, !dbg !18 +// CHECK:STDOUT: %MakePointerSize.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc26_47.1.temp, i32 0, i32 0, !dbg !17 +// CHECK:STDOUT: store ptr @array.loc25_52.18, ptr %MakePointerSize.call.init_list.begin, align 8, !dbg !17 +// CHECK:STDOUT: %MakePointerSize.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc26_47.1.temp, i32 0, i32 8, !dbg !17 +// CHECK:STDOUT: store i64 4, ptr %MakePointerSize.call.init_list.size, align 8, !dbg !17 +// CHECK:STDOUT: call void @_CTakePointerSize.Main(ptr %.loc26_47.1.temp), !dbg !20 +// CHECK:STDOUT: call void @"_COp.8ab5ebc4f407c395:core.Destroy.Core"(ptr @array), !dbg !18 +// CHECK:STDOUT: call void @"_COp.8ab5ebc4f407c395:core.Destroy.Core"(ptr @array), !dbg !16 +// CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !21 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !22 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8ab5ebc4f407c395:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// CHECK:STDOUT: define weak_odr void @"_COp.8ab5ebc4f407c395:core.Destroy.Core"(ptr %self) #0 !dbg !29 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -119,32 +119,33 @@ fn Test() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !1, line: 24, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 25, column: 22, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 25, column: 41, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 26, column: 19, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 26, column: 35, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 25, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 26, column: 3, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 24, column: 1, scope: !11) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 26, type: !22, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !25) -// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) -// CHECK:STDOUT: !23 = !{null, !24} -// CHECK:STDOUT: !24 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !25 = !{!26} -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !21, type: !24) -// CHECK:STDOUT: !27 = !DILocation(line: 26, column: 35, scope: !21) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8ab5ebc4f407c395:core.Destroy.Core", scope: null, file: !1, line: 26, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !32) -// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) -// CHECK:STDOUT: !30 = !{null, !31} -// CHECK:STDOUT: !31 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !32 = !{!33} -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !28, type: !31) -// CHECK:STDOUT: !34 = !DILocation(line: 26, column: 35, scope: !28) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !1, line: 24, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 25, column: 22, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 25, column: 41, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 26, column: 19, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 26, column: 35, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 25, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 26, column: 3, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 24, column: 1, scope: !12) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 26, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) +// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !24 = !{null, !25} +// CHECK:STDOUT: !25 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !22, type: !25) +// CHECK:STDOUT: !28 = !DILocation(line: 26, column: 35, scope: !22) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8ab5ebc4f407c395:core.Destroy.Core", scope: null, file: !1, line: 26, type: !30, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) +// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) +// CHECK:STDOUT: !31 = !{null, !32} +// CHECK:STDOUT: !32 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !33 = !{!34} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !29, type: !32) +// CHECK:STDOUT: !35 = !DILocation(line: 26, column: 35, scope: !29) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/static.carbon b/toolchain/lower/testdata/class/static.carbon index da6c1c953f127..a76c3ce3d4309 100644 --- a/toolchain/lower/testdata/class/static.carbon +++ b/toolchain/lower/testdata/class/static.carbon @@ -97,35 +97,35 @@ fn Run() -> i32 { // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define dso_local noundef i32 @_Z1Fv() #0 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %0 = load i32, ptr @_Cx.C.Main, align 4, !tbaa !7 +// CHECK:STDOUT: %0 = load i32, ptr @_Cx.C.Main, align 4, !tbaa !12 // CHECK:STDOUT: ret i32 %0 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #1 !dbg !11 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #1 !dbg !13 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %self), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !17 +// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %self), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %self) #2 !dbg !18 { +// CHECK:STDOUT: define weak_odr void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %self) #2 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @main() #2 !dbg !22 { +// CHECK:STDOUT: define i32 @main() #2 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call i32 @_Z1Fv(), !dbg !26 -// CHECK:STDOUT: ret i32 %F.call, !dbg !27 +// CHECK:STDOUT: %F.call = call i32 @_Z1Fv(), !dbg !28 +// CHECK:STDOUT: ret i32 %F.call, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #2 !dbg !28 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #2 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: store i32 123, ptr @_Cx.C.Main, align 4, !dbg !31 -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: store i32 123, ptr @_Cx.C.Main, align 4, !dbg !33 +// CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -143,30 +143,32 @@ fn Run() -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !1, line: 4, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 4, column: 1, scope: !11) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.807eb4f2d3ed7e54:core.Destroy.Core", scope: null, file: !1, line: 4, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !19) -// CHECK:STDOUT: !19 = !{!20} -// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !18, type: !14) -// CHECK:STDOUT: !21 = !DILocation(line: 4, column: 1, scope: !18) -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !1, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) -// CHECK:STDOUT: !24 = !{!25} -// CHECK:STDOUT: !25 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !26 = !DILocation(line: 15, column: 10, scope: !22) -// CHECK:STDOUT: !27 = !DILocation(line: 15, column: 3, scope: !22) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !29, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) -// CHECK:STDOUT: !30 = !{null} -// CHECK:STDOUT: !31 = !DILocation(line: 5, column: 10, scope: !28) -// CHECK:STDOUT: !32 = !DILocation(line: 0, scope: !28) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!9, !9, i64 0} +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !1, line: 4, type: !14, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !17) +// CHECK:STDOUT: !14 = !DISubroutineType(types: !15) +// CHECK:STDOUT: !15 = !{null, !16} +// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !17 = !{!18} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !13, type: !16) +// CHECK:STDOUT: !19 = !DILocation(line: 4, column: 1, scope: !13) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.807eb4f2d3ed7e54:core.Destroy.Core", scope: null, file: !1, line: 4, type: !14, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) +// CHECK:STDOUT: !21 = !{!22} +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !16) +// CHECK:STDOUT: !23 = !DILocation(line: 4, column: 1, scope: !20) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !1, line: 14, type: !25, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !28 = !DILocation(line: 15, column: 10, scope: !24) +// CHECK:STDOUT: !29 = !DILocation(line: 15, column: 3, scope: !24) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !31, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) +// CHECK:STDOUT: !32 = !{null} +// CHECK:STDOUT: !33 = !DILocation(line: 5, column: 10, scope: !30) +// CHECK:STDOUT: !34 = !DILocation(line: 0, scope: !30) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/array.carbon b/toolchain/lower/testdata/interop/cpp/array.carbon index 26e6c4267f948..2ba9d3f0c251d 100644 --- a/toolchain/lower/testdata/interop/cpp/array.carbon +++ b/toolchain/lower/testdata/interop/cpp/array.carbon @@ -54,8 +54,8 @@ int H() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %retval = alloca i32, align 4 // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !11 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !11, !nonnull !14, !align !15 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !12, !nonnull !15, !align !16 // CHECK:STDOUT: call void @_CF__carbon_thunk.Main(ptr noundef nonnull align 4 dereferenceable(20) %1, ptr noundef nonnull align 4 dereferenceable(4) %retval) // CHECK:STDOUT: %2 = load i32, ptr %retval, align 4 // CHECK:STDOUT: ret i32 %2 @@ -69,7 +69,7 @@ int H() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %ref.tmp = alloca [5 x i32], align 4 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ref.tmp) #3 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %ref.tmp, ptr align 4 @constinit, i64 20, i1 false), !tbaa.struct !16 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %ref.tmp, ptr align 4 @constinit, i64 20, i1 false), !tbaa.struct !17 // CHECK:STDOUT: %call = call noundef i32 @_ZN6CarbonL1FERA5_Ki(ptr noundef nonnull align 4 dereferenceable(20) %ref.tmp) // CHECK:STDOUT: call void @llvm.lifetime.end.p0(ptr %ref.tmp) #3 // CHECK:STDOUT: ret i32 %call @@ -79,19 +79,19 @@ int H() { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CF.Main(ptr %a) #3 !dbg !18 { +// CHECK:STDOUT: define i32 @_CF.Main(ptr %a) #3 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc5_43.2.array.index = getelementptr inbounds [5 x i32], ptr %a, i32 0, i32 2, !dbg !25 -// CHECK:STDOUT: %.loc5_43.3 = load i32, ptr %.loc5_43.2.array.index, align 4, !dbg !25 -// CHECK:STDOUT: ret i32 %.loc5_43.3, !dbg !26 +// CHECK:STDOUT: %.loc5_43.2.array.index = getelementptr inbounds [5 x i32], ptr %a, i32 0, i32 2, !dbg !26 +// CHECK:STDOUT: %.loc5_43.3 = load i32, ptr %.loc5_43.2.array.index, align 4, !dbg !26 +// CHECK:STDOUT: ret i32 %.loc5_43.3, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.Main(ptr %_, ptr %_1) #3 !dbg !27 { +// CHECK:STDOUT: define void @_CF__carbon_thunk.Main(ptr %_, ptr %_1) #3 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr %_), !dbg !33 -// CHECK:STDOUT: store i32 %F.call, ptr %_1, align 4, !dbg !33 -// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr %_), !dbg !34 +// CHECK:STDOUT: store i32 %F.call, ptr %_1, align 4, !dbg !34 +// CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -110,31 +110,32 @@ int H() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 int", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = !{} -// CHECK:STDOUT: !15 = !{i64 4} -// CHECK:STDOUT: !16 = !{i64 0, i64 20, !17} -// CHECK:STDOUT: !17 = !{!9, !9, i64 0} -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 5, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23) -// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) -// CHECK:STDOUT: !20 = !{!21, !22} -// CHECK:STDOUT: !21 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !23 = !{!24} -// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !18, type: !22) -// CHECK:STDOUT: !25 = !DILocation(line: 5, column: 40, scope: !18) -// CHECK:STDOUT: !26 = !DILocation(line: 5, column: 33, scope: !18) -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Main", scope: null, file: !1, line: 5, type: !28, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) -// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) -// CHECK:STDOUT: !29 = !{null, !22, !21} -// CHECK:STDOUT: !30 = !{!31, !32} -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !27, type: !22) -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 2, scope: !27, type: !21) -// CHECK:STDOUT: !33 = !DILocation(line: 5, column: 1, scope: !27) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 int", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = !{} +// CHECK:STDOUT: !16 = !{i64 4} +// CHECK:STDOUT: !17 = !{i64 0, i64 20, !18} +// CHECK:STDOUT: !18 = !{!10, !10, i64 0} +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 5, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{!22, !23} +// CHECK:STDOUT: !22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{!25} +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !19, type: !23) +// CHECK:STDOUT: !26 = !DILocation(line: 5, column: 40, scope: !19) +// CHECK:STDOUT: !27 = !DILocation(line: 5, column: 33, scope: !19) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Main", scope: null, file: !1, line: 5, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{null, !23, !22} +// CHECK:STDOUT: !31 = !{!32, !33} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !23) +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 2, scope: !28, type: !22) +// CHECK:STDOUT: !34 = !DILocation(line: 5, column: 1, scope: !28) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/clang_code_generator_callbacks.carbon b/toolchain/lower/testdata/interop/cpp/clang_code_generator_callbacks.carbon index 8650ca8f66212..4a17079c1bd0b 100644 --- a/toolchain/lower/testdata/interop/cpp/clang_code_generator_callbacks.carbon +++ b/toolchain/lower/testdata/interop/cpp/clang_code_generator_callbacks.carbon @@ -93,7 +93,7 @@ void f2() { // CHECK:STDOUT: define dso_local void @_ZN2t12f1Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #0 align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -101,7 +101,7 @@ void f2() { // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define dso_local noundef i32 @_Z1fv() #0 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %0 = load i32, ptr getelementptr inbounds nuw (i8, ptr @a, i64 12), align 4, !tbaa !14 +// CHECK:STDOUT: %0 = load i32, ptr getelementptr inbounds nuw (i8, ptr @a, i64 12), align 4, !tbaa !15 // CHECK:STDOUT: ret i32 %0 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -109,7 +109,7 @@ void f2() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN2t24funcEv(ptr noundef nonnull align 1 dereferenceable(1) %this) #0 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -117,7 +117,7 @@ void f2() { // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define dso_local void @_Z2f2v() #0 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: store i32 42, ptr @_ZN2t3IiE1iE, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 42, ptr @_ZN2t3IiE1iE, align 4, !tbaa !19 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -134,15 +134,17 @@ void f2() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTS2t1", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = !{!15, !8, i64 0} -// CHECK:STDOUT: !15 = !{!"_ZTS1S", !8, i64 0} -// CHECK:STDOUT: !16 = !{!17, !17, i64 0} -// CHECK:STDOUT: !17 = !{!"p1 _ZTS2t2", !13, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTS2t1", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = !{!16, !9, i64 0} +// CHECK:STDOUT: !16 = !{!"_ZTS1S", !9, i64 0} +// CHECK:STDOUT: !17 = !{!18, !18, i64 0} +// CHECK:STDOUT: !18 = !{!"p1 _ZTS2t2", !14, i64 0} +// CHECK:STDOUT: !19 = !{!9, !9, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/export/class.carbon b/toolchain/lower/testdata/interop/cpp/class/export/class.carbon index 1c6c928d71526..c23a25b2449ab 100644 --- a/toolchain/lower/testdata/interop/cpp/class/export/class.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/class.carbon @@ -104,8 +104,8 @@ fn G() { // CHECK:STDOUT: define dso_local noundef ptr @_Z4passPN6Carbon1AE(ptr noundef %p) #0 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %p.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %p, ptr %p.addr, align 8, !tbaa !11 -// CHECK:STDOUT: %0 = load ptr, ptr %p.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %p, ptr %p.addr, align 8, !tbaa !12 +// CHECK:STDOUT: %0 = load ptr, ptr %p.addr, align 8, !tbaa !12 // CHECK:STDOUT: ret ptr %0 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -117,10 +117,10 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CDoIt.Main() #1 !dbg !14 { +// CHECK:STDOUT: define void @_CDoIt.Main() #1 !dbg !15 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4callv(), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: call void @_Z4callv(), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -137,18 +137,19 @@ fn G() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTSN6Carbon1AE", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "DoIt", linkageName: "_CDoIt.Main", scope: null, file: !1, line: 15, type: !15, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !16 = !{null} -// CHECK:STDOUT: !17 = !DILocation(line: 15, column: 13, scope: !14) -// CHECK:STDOUT: !18 = !DILocation(line: 15, column: 1, scope: !14) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon1AE", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "DoIt", linkageName: "_CDoIt.Main", scope: null, file: !1, line: 15, type: !16, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !16 = !DISubroutineType(types: !17) +// CHECK:STDOUT: !17 = !{null} +// CHECK:STDOUT: !18 = !DILocation(line: 15, column: 13, scope: !15) +// CHECK:STDOUT: !19 = !DILocation(line: 15, column: 1, scope: !15) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'layout.carbon' @@ -184,7 +185,7 @@ fn G() { // CHECK:STDOUT: define internal void @_ZN6CarbonL5CallAEPNS_1AE(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12 // CHECK:STDOUT: call void @_CCallA__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -193,7 +194,7 @@ fn G() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.A.Main"(ptr noundef nonnull align 8 dereferenceable(12) %this1) // CHECK:STDOUT: ret void @@ -217,7 +218,7 @@ fn G() { // CHECK:STDOUT: define internal void @_ZN6CarbonL5CallBEPNS_1BE(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !14 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !15 // CHECK:STDOUT: call void @_CCallB__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -226,7 +227,7 @@ fn G() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1BD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !14 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !15 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.B.Main"(ptr noundef nonnull align 8 dereferenceable(16) %this1) // CHECK:STDOUT: %a = getelementptr inbounds nuw %"class.Carbon::B", ptr %this1, i32 0, i32 0 @@ -250,7 +251,7 @@ fn G() { // CHECK:STDOUT: define internal void @_ZN6CarbonL5CallCEPNS_1CE(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !17 // CHECK:STDOUT: call void @_CCallC__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -259,7 +260,7 @@ fn G() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1CD2Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.C.Main"(ptr noundef nonnull align 8 dereferenceable(16) %this1) // CHECK:STDOUT: call void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %this1) #5 @@ -273,90 +274,90 @@ fn G() { // CHECK:STDOUT: declare void @_CCallC.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #4 !dbg !18 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #4 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self), !dbg !24 -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self), !dbg !25 +// CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #5 !dbg !25 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #5 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b0e8b846ec8794f3:core.Destroy.Core"(ptr %self) #5 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_COp.b0e8b846ec8794f3:core.Destroy.Core"(ptr %self) #5 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self) #5 !dbg !36 { +// CHECK:STDOUT: define weak_odr void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self) #5 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !39 +// CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallA__carbon_thunk.Main(ptr %_) #5 !dbg !40 { +// CHECK:STDOUT: define void @_CCallA__carbon_thunk.Main(ptr %_) #5 !dbg !41 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc21 = load ptr, ptr %_, align 8, !dbg !43 -// CHECK:STDOUT: call void @_CCallA.Main(ptr %.loc21), !dbg !43 -// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: %.loc21 = load ptr, ptr %_, align 8, !dbg !44 +// CHECK:STDOUT: call void @_CCallA.Main(ptr %.loc21), !dbg !44 +// CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.B.Main"(ptr %self) #4 !dbg !44 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.B.Main"(ptr %self) #4 !dbg !45 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.6c3865e9cbd9f6de:core.Destroy.Core"(ptr %self), !dbg !47 -// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: call void @"_COp.6c3865e9cbd9f6de:core.Destroy.Core"(ptr %self), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.470dcacdfb83e588:core.Destroy.Core"(ptr %self) #5 !dbg !48 { +// CHECK:STDOUT: define weak_odr void @"_COp.470dcacdfb83e588:core.Destroy.Core"(ptr %self) #5 !dbg !49 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6c3865e9cbd9f6de:core.Destroy.Core"(ptr %self) #5 !dbg !52 { +// CHECK:STDOUT: define weak_odr void @"_COp.6c3865e9cbd9f6de:core.Destroy.Core"(ptr %self) #5 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallB__carbon_thunk.Main(ptr %_) #5 !dbg !56 { +// CHECK:STDOUT: define void @_CCallB__carbon_thunk.Main(ptr %_) #5 !dbg !57 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22 = load ptr, ptr %_, align 8, !dbg !59 -// CHECK:STDOUT: call void @_CCallB.Main(ptr %.loc22), !dbg !59 -// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: %.loc22 = load ptr, ptr %_, align 8, !dbg !60 +// CHECK:STDOUT: call void @_CCallB.Main(ptr %.loc22), !dbg !60 +// CHECK:STDOUT: ret void, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #4 !dbg !60 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #4 !dbg !61 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %self), !dbg !63 -// CHECK:STDOUT: ret void, !dbg !63 +// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %self), !dbg !64 +// CHECK:STDOUT: ret void, !dbg !64 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.67ca81f926811f5a:core.Destroy.Core"(ptr %self) #5 !dbg !64 { +// CHECK:STDOUT: define weak_odr void @"_COp.67ca81f926811f5a:core.Destroy.Core"(ptr %self) #5 !dbg !65 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: ret void, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %self) #5 !dbg !68 { +// CHECK:STDOUT: define weak_odr void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %self) #5 !dbg !69 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: ret void, !dbg !72 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallC__carbon_thunk.Main(ptr %_) #5 !dbg !72 { +// CHECK:STDOUT: define void @_CCallC__carbon_thunk.Main(ptr %_) #5 !dbg !73 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc23 = load ptr, ptr %_, align 8, !dbg !75 -// CHECK:STDOUT: call void @_CCallC.Main(ptr %.loc23), !dbg !75 -// CHECK:STDOUT: ret void, !dbg !75 +// CHECK:STDOUT: %.loc23 = load ptr, ptr %_, align 8, !dbg !76 +// CHECK:STDOUT: call void @_CCallC.Main(ptr %.loc23), !dbg !76 +// CHECK:STDOUT: ret void, !dbg !76 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -380,75 +381,76 @@ fn G() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTSN6Carbon1AE", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = !{!15, !15, i64 0} -// CHECK:STDOUT: !15 = !{!"p1 _ZTSN6Carbon1BE", !13, i64 0} -// CHECK:STDOUT: !16 = !{!17, !17, i64 0} -// CHECK:STDOUT: !17 = !{!"p1 _ZTSN6Carbon1CE", !13, i64 0} -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 6, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) -// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) -// CHECK:STDOUT: !20 = !{null, !21} -// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !22 = !{!23} -// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !18, type: !21) -// CHECK:STDOUT: !24 = !DILocation(line: 6, column: 1, scope: !18) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 6, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !29) -// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) -// CHECK:STDOUT: !27 = !{null, !28} -// CHECK:STDOUT: !28 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !29 = !{!30} -// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !25, type: !28) -// CHECK:STDOUT: !31 = !DILocation(line: 6, column: 1, scope: !25) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b0e8b846ec8794f3:core.Destroy.Core", scope: null, file: !1, line: 6, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) -// CHECK:STDOUT: !33 = !{!34} -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !21) -// CHECK:STDOUT: !35 = !DILocation(line: 6, column: 1, scope: !32) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !1, line: 6, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !37) -// CHECK:STDOUT: !37 = !{!38} -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !21) -// CHECK:STDOUT: !39 = !DILocation(line: 6, column: 1, scope: !36) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "CallA__carbon_thunk", linkageName: "_CCallA__carbon_thunk.Main", scope: null, file: !1, line: 21, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !41) -// CHECK:STDOUT: !41 = !{!42} -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !21) -// CHECK:STDOUT: !43 = !DILocation(line: 21, column: 1, scope: !40) -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.B.Main", scope: null, file: !1, line: 11, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !45) -// CHECK:STDOUT: !45 = !{!46} -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !44, type: !21) -// CHECK:STDOUT: !47 = !DILocation(line: 11, column: 1, scope: !44) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "Op", linkageName: "_COp.470dcacdfb83e588:core.Destroy.Core", scope: null, file: !1, line: 11, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !49) -// CHECK:STDOUT: !49 = !{!50} -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !48, type: !21) -// CHECK:STDOUT: !51 = !DILocation(line: 11, column: 1, scope: !48) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6c3865e9cbd9f6de:core.Destroy.Core", scope: null, file: !1, line: 11, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !53) -// CHECK:STDOUT: !53 = !{!54} -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !52, type: !21) -// CHECK:STDOUT: !55 = !DILocation(line: 11, column: 1, scope: !52) -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "CallB__carbon_thunk", linkageName: "_CCallB__carbon_thunk.Main", scope: null, file: !1, line: 22, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !57) -// CHECK:STDOUT: !57 = !{!58} -// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !56, type: !21) -// CHECK:STDOUT: !59 = !DILocation(line: 22, column: 1, scope: !56) -// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !1, line: 16, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !61) -// CHECK:STDOUT: !61 = !{!62} -// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !60, type: !21) -// CHECK:STDOUT: !63 = !DILocation(line: 16, column: 1, scope: !60) -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Op", linkageName: "_COp.67ca81f926811f5a:core.Destroy.Core", scope: null, file: !1, line: 16, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !65) -// CHECK:STDOUT: !65 = !{!66} -// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !64, type: !21) -// CHECK:STDOUT: !67 = !DILocation(line: 16, column: 1, scope: !64) -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Op", linkageName: "_COp.807eb4f2d3ed7e54:core.Destroy.Core", scope: null, file: !1, line: 16, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !69) -// CHECK:STDOUT: !69 = !{!70} -// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !68, type: !21) -// CHECK:STDOUT: !71 = !DILocation(line: 16, column: 1, scope: !68) -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "CallC__carbon_thunk", linkageName: "_CCallC__carbon_thunk.Main", scope: null, file: !1, line: 23, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !73) -// CHECK:STDOUT: !73 = !{!74} -// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !72, type: !21) -// CHECK:STDOUT: !75 = !DILocation(line: 23, column: 1, scope: !72) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon1AE", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = !{!16, !16, i64 0} +// CHECK:STDOUT: !16 = !{!"p1 _ZTSN6Carbon1BE", !14, i64 0} +// CHECK:STDOUT: !17 = !{!18, !18, i64 0} +// CHECK:STDOUT: !18 = !{!"p1 _ZTSN6Carbon1CE", !14, i64 0} +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 6, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !22} +// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 6, column: 1, scope: !19) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 6, type: !27, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) +// CHECK:STDOUT: !27 = !DISubroutineType(types: !28) +// CHECK:STDOUT: !28 = !{null, !29} +// CHECK:STDOUT: !29 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !30 = !{!31} +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !26, type: !29) +// CHECK:STDOUT: !32 = !DILocation(line: 6, column: 1, scope: !26) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b0e8b846ec8794f3:core.Destroy.Core", scope: null, file: !1, line: 6, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !22) +// CHECK:STDOUT: !36 = !DILocation(line: 6, column: 1, scope: !33) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !1, line: 6, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38) +// CHECK:STDOUT: !38 = !{!39} +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !22) +// CHECK:STDOUT: !40 = !DILocation(line: 6, column: 1, scope: !37) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "CallA__carbon_thunk", linkageName: "_CCallA__carbon_thunk.Main", scope: null, file: !1, line: 21, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !42) +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !22) +// CHECK:STDOUT: !44 = !DILocation(line: 21, column: 1, scope: !41) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.B.Main", scope: null, file: !1, line: 11, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !46) +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !22) +// CHECK:STDOUT: !48 = !DILocation(line: 11, column: 1, scope: !45) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.470dcacdfb83e588:core.Destroy.Core", scope: null, file: !1, line: 11, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !50) +// CHECK:STDOUT: !50 = !{!51} +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !22) +// CHECK:STDOUT: !52 = !DILocation(line: 11, column: 1, scope: !49) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6c3865e9cbd9f6de:core.Destroy.Core", scope: null, file: !1, line: 11, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !54) +// CHECK:STDOUT: !54 = !{!55} +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !22) +// CHECK:STDOUT: !56 = !DILocation(line: 11, column: 1, scope: !53) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "CallB__carbon_thunk", linkageName: "_CCallB__carbon_thunk.Main", scope: null, file: !1, line: 22, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !58) +// CHECK:STDOUT: !58 = !{!59} +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !57, type: !22) +// CHECK:STDOUT: !60 = !DILocation(line: 22, column: 1, scope: !57) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !1, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !62) +// CHECK:STDOUT: !62 = !{!63} +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !61, type: !22) +// CHECK:STDOUT: !64 = !DILocation(line: 16, column: 1, scope: !61) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.67ca81f926811f5a:core.Destroy.Core", scope: null, file: !1, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !66) +// CHECK:STDOUT: !66 = !{!67} +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !65, type: !22) +// CHECK:STDOUT: !68 = !DILocation(line: 16, column: 1, scope: !65) +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.807eb4f2d3ed7e54:core.Destroy.Core", scope: null, file: !1, line: 16, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !70) +// CHECK:STDOUT: !70 = !{!71} +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !69, type: !22) +// CHECK:STDOUT: !72 = !DILocation(line: 16, column: 1, scope: !69) +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "CallC__carbon_thunk", linkageName: "_CCallC__carbon_thunk.Main", scope: null, file: !1, line: 23, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !74) +// CHECK:STDOUT: !74 = !{!75} +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !73, type: !22) +// CHECK:STDOUT: !76 = !DILocation(line: 23, column: 1, scope: !73) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'field.carbon' @@ -464,52 +466,52 @@ fn G() { // CHECK:STDOUT: define dso_local void @_Z1FRN6Carbon1CE(ptr noundef nonnull align 4 dereferenceable(8) %c) #0 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %c.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !11 -// CHECK:STDOUT: %0 = load ptr, ptr %c.addr, align 8, !tbaa !11, !nonnull !14, !align !15 +// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !12 +// CHECK:STDOUT: %0 = load ptr, ptr %c.addr, align 8, !tbaa !12, !nonnull !15, !align !16 // CHECK:STDOUT: %a = getelementptr inbounds nuw %"class.Carbon::C", ptr %0, i32 0, i32 0 -// CHECK:STDOUT: store i32 12, ptr %a, align 4, !tbaa !16 -// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8, !tbaa !11, !nonnull !14, !align !15 +// CHECK:STDOUT: store i32 12, ptr %a, align 4, !tbaa !17 +// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8, !tbaa !12, !nonnull !15, !align !16 // CHECK:STDOUT: %b = getelementptr inbounds nuw %"class.Carbon::C", ptr %1, i32 0, i32 1 -// CHECK:STDOUT: store i32 34, ptr %b, align 4, !tbaa !18 +// CHECK:STDOUT: store i32 34, ptr %b, align 4, !tbaa !19 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #1 !dbg !19 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #1 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %self), !dbg !25 -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %self), !dbg !26 +// CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #2 !dbg !26 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #2 !dbg !27 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f30036b66b652106:core.Destroy.Core"(ptr %self) #2 !dbg !33 { +// CHECK:STDOUT: define weak_odr void @"_COp.f30036b66b652106:core.Destroy.Core"(ptr %self) #2 !dbg !34 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %self) #2 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %self) #2 !dbg !38 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: ret void, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #2 !dbg !41 { +// CHECK:STDOUT: define void @_CG.Main() #2 !dbg !42 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i32, i32 }, align 4, !dbg !44 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !44 -// CHECK:STDOUT: %.loc19_29.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 0, !dbg !45 -// CHECK:STDOUT: %.loc19_29.6.b = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 1, !dbg !45 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.loc19_3, i64 8, i1 false), !dbg !44 -// CHECK:STDOUT: call void @_Z1FRN6Carbon1CE(ptr %c.var), !dbg !46 -// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %c.var), !dbg !44 -// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: %c.var = alloca { i32, i32 }, align 4, !dbg !45 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !45 +// CHECK:STDOUT: %.loc19_29.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 0, !dbg !46 +// CHECK:STDOUT: %.loc19_29.6.b = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 1, !dbg !46 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @C.val.loc19_3, i64 8, i1 false), !dbg !45 +// CHECK:STDOUT: call void @_Z1FRN6Carbon1CE(ptr %c.var), !dbg !47 +// CHECK:STDOUT: call void @"_COp.807eb4f2d3ed7e54:core.Destroy.Core"(ptr %c.var), !dbg !45 +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -534,45 +536,46 @@ fn G() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTSN6Carbon1CE", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = !{} -// CHECK:STDOUT: !15 = !{i64 4} -// CHECK:STDOUT: !16 = !{!17, !8, i64 0} -// CHECK:STDOUT: !17 = !{!"_ZTSN6Carbon1CE", !8, i64 0, !8, i64 4} -// CHECK:STDOUT: !18 = !{!17, !8, i64 4} -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !1, line: 6, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23) -// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !21 = !{null, !22} -// CHECK:STDOUT: !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !23 = !{!24} -// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) -// CHECK:STDOUT: !25 = !DILocation(line: 6, column: 1, scope: !19) -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 6, type: !27, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) -// CHECK:STDOUT: !27 = !DISubroutineType(types: !28) -// CHECK:STDOUT: !28 = !{null, !29} -// CHECK:STDOUT: !29 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !30 = !{!31} -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !26, type: !29) -// CHECK:STDOUT: !32 = !DILocation(line: 6, column: 1, scope: !26) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f30036b66b652106:core.Destroy.Core", scope: null, file: !1, line: 6, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34) -// CHECK:STDOUT: !34 = !{!35} -// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !22) -// CHECK:STDOUT: !36 = !DILocation(line: 6, column: 1, scope: !33) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.807eb4f2d3ed7e54:core.Destroy.Core", scope: null, file: !1, line: 6, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38) -// CHECK:STDOUT: !38 = !{!39} -// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !22) -// CHECK:STDOUT: !40 = !DILocation(line: 6, column: 1, scope: !37) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !1, line: 18, type: !42, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !42 = !DISubroutineType(types: !43) -// CHECK:STDOUT: !43 = !{null} -// CHECK:STDOUT: !44 = !DILocation(line: 19, column: 3, scope: !41) -// CHECK:STDOUT: !45 = !DILocation(line: 19, column: 14, scope: !41) -// CHECK:STDOUT: !46 = !DILocation(line: 20, column: 3, scope: !41) -// CHECK:STDOUT: !47 = !DILocation(line: 18, column: 1, scope: !41) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon1CE", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = !{} +// CHECK:STDOUT: !16 = !{i64 4} +// CHECK:STDOUT: !17 = !{!18, !9, i64 0} +// CHECK:STDOUT: !18 = !{!"_ZTSN6Carbon1CE", !9, i64 0, !9, i64 4} +// CHECK:STDOUT: !19 = !{!18, !9, i64 4} +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !1, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24) +// CHECK:STDOUT: !21 = !DISubroutineType(types: !22) +// CHECK:STDOUT: !22 = !{null, !23} +// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !24 = !{!25} +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !20, type: !23) +// CHECK:STDOUT: !26 = !DILocation(line: 6, column: 1, scope: !20) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 6, type: !28, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) +// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) +// CHECK:STDOUT: !29 = !{null, !30} +// CHECK:STDOUT: !30 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !27, type: !30) +// CHECK:STDOUT: !33 = !DILocation(line: 6, column: 1, scope: !27) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f30036b66b652106:core.Destroy.Core", scope: null, file: !1, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !35) +// CHECK:STDOUT: !35 = !{!36} +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !23) +// CHECK:STDOUT: !37 = !DILocation(line: 6, column: 1, scope: !34) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.807eb4f2d3ed7e54:core.Destroy.Core", scope: null, file: !1, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !39) +// CHECK:STDOUT: !39 = !{!40} +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !23) +// CHECK:STDOUT: !41 = !DILocation(line: 6, column: 1, scope: !38) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !1, line: 18, type: !43, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !43 = !DISubroutineType(types: !44) +// CHECK:STDOUT: !44 = !{null} +// CHECK:STDOUT: !45 = !DILocation(line: 19, column: 3, scope: !42) +// CHECK:STDOUT: !46 = !DILocation(line: 19, column: 14, scope: !42) +// CHECK:STDOUT: !47 = !DILocation(line: 20, column: 3, scope: !42) +// CHECK:STDOUT: !48 = !DILocation(line: 18, column: 1, scope: !42) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/export/mangle.carbon b/toolchain/lower/testdata/interop/cpp/class/export/mangle.carbon index cc893792cbae0..19fb4e53419e0 100644 --- a/toolchain/lower/testdata/interop/cpp/class/export/mangle.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/mangle.carbon @@ -48,7 +48,7 @@ void f1(Carbon::Other::Class1*) { // CHECK:STDOUT: define dso_local void @_Z2f1PN6Carbon5Other6Class1E(ptr noundef %0) #0 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -65,11 +65,12 @@ void f1(Carbon::Other::Class1*) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTSN6Carbon5Other6Class1E", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon5Other6Class1E", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/export/method.carbon b/toolchain/lower/testdata/interop/cpp/class/export/method.carbon index 5e36e8e57b024..2a1cf1aba2266 100644 --- a/toolchain/lower/testdata/interop/cpp/class/export/method.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/method.carbon @@ -91,7 +91,7 @@ fn CallCallF() { Cpp.CallF(); } // CHECK:STDOUT: define internal void @_ZN6Carbon1A1FEv(ptr noundef nonnull align 1 %this) #2 align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_CF__carbon_thunk.A.Main(ptr noundef nonnull align 1 %this1) // CHECK:STDOUT: ret void @@ -101,7 +101,7 @@ fn CallCallF() { Cpp.CallF(); } // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.A.Main"(ptr noundef nonnull align 1 %this1) // CHECK:STDOUT: ret void @@ -111,29 +111,29 @@ fn CallCallF() { Cpp.CallF(); } // CHECK:STDOUT: declare void @llvm.lifetime.end.p0(ptr captures(none)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.A.Main(ptr %self) #4 !dbg !14 { +// CHECK:STDOUT: define void @_CF.A.Main(ptr %self) #4 !dbg !15 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !20 +// CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #5 !dbg !21 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #5 !dbg !22 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self), !dbg !24 -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self), !dbg !25 +// CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self) #4 !dbg !25 { +// CHECK:STDOUT: define weak_odr void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self) #4 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main(ptr %self) #4 !dbg !29 { +// CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main(ptr %self) #4 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.A.Main(ptr %self), !dbg !32 -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: call void @_CF.A.Main(ptr %self), !dbg !33 +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -154,32 +154,33 @@ fn CallCallF() { Cpp.CallF(); } // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTSN6Carbon1AE", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "F", linkageName: "_CF.A.Main", scope: null, file: !1, line: 6, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !18) -// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !16 = !{null, !17} -// CHECK:STDOUT: !17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !18 = !{!19} -// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !14, type: !17) -// CHECK:STDOUT: !20 = !DILocation(line: 6, column: 3, scope: !14) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 5, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) -// CHECK:STDOUT: !22 = !{!23} -// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !21, type: !17) -// CHECK:STDOUT: !24 = !DILocation(line: 5, column: 1, scope: !21) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !1, line: 5, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) -// CHECK:STDOUT: !26 = !{!27} -// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !17) -// CHECK:STDOUT: !28 = !DILocation(line: 5, column: 1, scope: !25) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.A.Main", scope: null, file: !1, line: 6, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) -// CHECK:STDOUT: !30 = !{!31} -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !17) -// CHECK:STDOUT: !32 = !DILocation(line: 6, column: 3, scope: !29) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon1AE", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "F", linkageName: "_CF.A.Main", scope: null, file: !1, line: 6, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !19) +// CHECK:STDOUT: !16 = !DISubroutineType(types: !17) +// CHECK:STDOUT: !17 = !{null, !18} +// CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !19 = !{!20} +// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !15, type: !18) +// CHECK:STDOUT: !21 = !DILocation(line: 6, column: 3, scope: !15) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 5, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !22, type: !18) +// CHECK:STDOUT: !25 = !DILocation(line: 5, column: 1, scope: !22) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !1, line: 5, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !18) +// CHECK:STDOUT: !29 = !DILocation(line: 5, column: 1, scope: !26) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.A.Main", scope: null, file: !1, line: 6, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !18) +// CHECK:STDOUT: !33 = !DILocation(line: 6, column: 3, scope: !30) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'method_with_args_and_return.carbon' @@ -211,8 +212,8 @@ fn CallCallF() { Cpp.CallF(); } // CHECK:STDOUT: %retval = alloca i32, align 4 // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr = alloca i32, align 4 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !11 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !15 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_CF__carbon_thunk.A.Main(ptr noundef nonnull align 1 %this1, ptr noundef nonnull align 4 dereferenceable(4) %.addr, ptr noundef nonnull align 4 dereferenceable(4) %retval) // CHECK:STDOUT: %1 = load i32, ptr %retval, align 4 @@ -223,7 +224,7 @@ fn CallCallF() { Cpp.CallF(); } // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.A.Main"(ptr noundef nonnull align 1 %this1) // CHECK:STDOUT: ret void @@ -233,38 +234,38 @@ fn CallCallF() { Cpp.CallF(); } // CHECK:STDOUT: declare void @llvm.lifetime.end.p0(ptr captures(none)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CF.A.Main(ptr %self, i32 %a) #4 !dbg !14 { +// CHECK:STDOUT: define i32 @_CF.A.Main(ptr %self, i32 %a) #4 !dbg !16 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %a, !dbg !22 +// CHECK:STDOUT: ret i32 %a, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #5 !dbg !23 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #5 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self), !dbg !28 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self), !dbg !30 +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self) #4 !dbg !29 { +// CHECK:STDOUT: define weak_odr void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self) #4 !dbg !31 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main(ptr %self, ptr %_, ptr %_1) #4 !dbg !33 { +// CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main(ptr %self, ptr %_, ptr %_1) #4 !dbg !35 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_29.2 = load i32, ptr %_, align 4, !dbg !40 -// CHECK:STDOUT: %A.F.call = call i32 @_CF.A.Main(ptr %self, i32 %.loc6_29.2), !dbg !40 -// CHECK:STDOUT: store i32 %A.F.call, ptr %_1, align 4, !dbg !40 -// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: %.loc6_29.2 = load i32, ptr %_, align 4, !dbg !42 +// CHECK:STDOUT: %A.F.call = call i32 @_CF.A.Main(ptr %self, i32 %.loc6_29.2), !dbg !42 +// CHECK:STDOUT: store i32 %A.F.call, ptr %_1, align 4, !dbg !42 +// CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CCallCallF.Main() #4 !dbg !41 { +// CHECK:STDOUT: define i32 @_CCallCallF.Main() #4 !dbg !43 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CallF.call = call i32 @_Z5CallFv(), !dbg !44 -// CHECK:STDOUT: ret i32 %CallF.call, !dbg !45 +// CHECK:STDOUT: %CallF.call = call i32 @_Z5CallFv(), !dbg !46 +// CHECK:STDOUT: ret i32 %CallF.call, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -285,45 +286,47 @@ fn CallCallF() { Cpp.CallF(); } // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTSN6Carbon1AE", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "F", linkageName: "_CF.A.Main", scope: null, file: !1, line: 6, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !19) -// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !16 = !{!17, !18, !17} -// CHECK:STDOUT: !17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !19 = !{!20, !21} -// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !14, type: !18) -// CHECK:STDOUT: !21 = !DILocalVariable(arg: 2, scope: !14, type: !17) -// CHECK:STDOUT: !22 = !DILocation(line: 8, column: 5, scope: !14) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) -// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) -// CHECK:STDOUT: !25 = !{null, !18} -// CHECK:STDOUT: !26 = !{!27} -// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !23, type: !18) -// CHECK:STDOUT: !28 = !DILocation(line: 5, column: 1, scope: !23) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !1, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) -// CHECK:STDOUT: !30 = !{!31} -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !18) -// CHECK:STDOUT: !32 = !DILocation(line: 5, column: 1, scope: !29) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.A.Main", scope: null, file: !1, line: 6, type: !34, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !36) -// CHECK:STDOUT: !34 = !DISubroutineType(types: !35) -// CHECK:STDOUT: !35 = !{null, !18, !17, !17} -// CHECK:STDOUT: !36 = !{!37, !38, !39} -// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !33, type: !18) -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 2, scope: !33, type: !17) -// CHECK:STDOUT: !39 = !DILocalVariable(arg: 3, scope: !33, type: !17) -// CHECK:STDOUT: !40 = !DILocation(line: 6, column: 3, scope: !33) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !1, line: 18, type: !42, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !42 = !DISubroutineType(types: !43) -// CHECK:STDOUT: !43 = !{!17} -// CHECK:STDOUT: !44 = !DILocation(line: 18, column: 32, scope: !41) -// CHECK:STDOUT: !45 = !DILocation(line: 18, column: 25, scope: !41) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon1AE", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = !{!9, !9, i64 0} +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "F", linkageName: "_CF.A.Main", scope: null, file: !1, line: 6, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) +// CHECK:STDOUT: !17 = !DISubroutineType(types: !18) +// CHECK:STDOUT: !18 = !{!19, !20, !19} +// CHECK:STDOUT: !19 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !21 = !{!22, !23} +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !16, type: !20) +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 2, scope: !16, type: !19) +// CHECK:STDOUT: !24 = !DILocation(line: 8, column: 5, scope: !16) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 5, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28) +// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) +// CHECK:STDOUT: !27 = !{null, !20} +// CHECK:STDOUT: !28 = !{!29} +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !25, type: !20) +// CHECK:STDOUT: !30 = !DILocation(line: 5, column: 1, scope: !25) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !1, line: 5, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !32) +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !20) +// CHECK:STDOUT: !34 = !DILocation(line: 5, column: 1, scope: !31) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.A.Main", scope: null, file: !1, line: 6, type: !36, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38) +// CHECK:STDOUT: !36 = !DISubroutineType(types: !37) +// CHECK:STDOUT: !37 = !{null, !20, !19, !19} +// CHECK:STDOUT: !38 = !{!39, !40, !41} +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !35, type: !20) +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 2, scope: !35, type: !19) +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 3, scope: !35, type: !19) +// CHECK:STDOUT: !42 = !DILocation(line: 6, column: 3, scope: !35) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !1, line: 18, type: !44, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !44 = !DISubroutineType(types: !45) +// CHECK:STDOUT: !45 = !{!19} +// CHECK:STDOUT: !46 = !DILocation(line: 18, column: 32, scope: !43) +// CHECK:STDOUT: !47 = !DILocation(line: 18, column: 25, scope: !43) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'static.carbon' @@ -346,36 +349,36 @@ fn CallCallF() { Cpp.CallF(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.A.Main() #2 !dbg !11 { +// CHECK:STDOUT: define void @_CF.A.Main() #2 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !14 +// CHECK:STDOUT: ret void, !dbg !15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #3 !dbg !15 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #3 !dbg !16 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self), !dbg !21 -// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self), !dbg !22 +// CHECK:STDOUT: ret void, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self) #2 !dbg !22 { +// CHECK:STDOUT: define weak_odr void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self) #2 !dbg !23 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main() #2 !dbg !26 { +// CHECK:STDOUT: define void @_CF__carbon_thunk.A.Main() #2 !dbg !27 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.A.Main(), !dbg !27 -// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: call void @_CF.A.Main(), !dbg !28 +// CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallCallF.Main() #2 !dbg !28 { +// CHECK:STDOUT: define void @_CCallCallF.Main() #2 !dbg !29 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z5CallFv(), !dbg !29 -// CHECK:STDOUT: ret void, !dbg !30 +// CHECK:STDOUT: call void @_Z5CallFv(), !dbg !30 +// CHECK:STDOUT: ret void, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -394,28 +397,29 @@ fn CallCallF() { Cpp.CallF(); } // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "F", linkageName: "_CF.A.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 6, column: 3, scope: !11) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 5, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !19) -// CHECK:STDOUT: !16 = !DISubroutineType(types: !17) -// CHECK:STDOUT: !17 = !{null, !18} -// CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !19 = !{!20} -// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !15, type: !18) -// CHECK:STDOUT: !21 = !DILocation(line: 5, column: 1, scope: !15) -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !1, line: 5, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23) -// CHECK:STDOUT: !23 = !{!24} -// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !22, type: !18) -// CHECK:STDOUT: !25 = !DILocation(line: 5, column: 1, scope: !22) -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.A.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !27 = !DILocation(line: 6, column: 3, scope: !26) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !1, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !29 = !DILocation(line: 15, column: 18, scope: !28) -// CHECK:STDOUT: !30 = !DILocation(line: 15, column: 1, scope: !28) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F", linkageName: "_CF.A.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 3, scope: !12) +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 5, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !20) +// CHECK:STDOUT: !17 = !DISubroutineType(types: !18) +// CHECK:STDOUT: !18 = !{null, !19} +// CHECK:STDOUT: !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !16, type: !19) +// CHECK:STDOUT: !22 = !DILocation(line: 5, column: 1, scope: !16) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !1, line: 5, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24) +// CHECK:STDOUT: !24 = !{!25} +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !23, type: !19) +// CHECK:STDOUT: !26 = !DILocation(line: 5, column: 1, scope: !23) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.A.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !28 = !DILocation(line: 6, column: 3, scope: !27) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !1, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !30 = !DILocation(line: 15, column: 18, scope: !29) +// CHECK:STDOUT: !31 = !DILocation(line: 15, column: 1, scope: !29) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/alignment.carbon b/toolchain/lower/testdata/interop/cpp/class/import/alignment.carbon index 616dd7f0b6e03..b178d3b1f5267 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/alignment.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/alignment.carbon @@ -63,91 +63,91 @@ fn Packed(n: i32) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CNaturallyAligned.Main(i32 %n) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CNaturallyAligned.Main(i32 %n) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca [4 x i8], align 4, !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !17 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619"(ptr %a.var), !dbg !17 -// CHECK:STDOUT: %.loc25.n = getelementptr inbounds nuw [4 x i8], ptr %a.var, i32 0, i32 0, !dbg !18 -// CHECK:STDOUT: store i32 %n, ptr %.loc25.n, align 4, !dbg !18 -// CHECK:STDOUT: call void @_Z4TakeI16NaturallyAlignedEvRT_(ptr %a.var), !dbg !19 -// CHECK:STDOUT: ret void, !dbg !20 +// CHECK:STDOUT: %a.var = alloca [4 x i8], align 4, !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !18 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619"(ptr %a.var), !dbg !18 +// CHECK:STDOUT: %.loc25.n = getelementptr inbounds nuw [4 x i8], ptr %a.var, i32 0, i32 0, !dbg !19 +// CHECK:STDOUT: store i32 %n, ptr %.loc25.n, align 4, !dbg !19 +// CHECK:STDOUT: call void @_Z4TakeI16NaturallyAlignedEvRT_(ptr %a.var), !dbg !20 +// CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN16NaturallyAlignedC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !21 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !22 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !22 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Default.c846b89dd79c7366.Core:NaturallyAligned.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !24 { +// CHECK:STDOUT: define void @"_COp:thunk:Default.c846b89dd79c7366.Core:NaturallyAligned.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN16NaturallyAlignedC1Ev.carbon_thunk.(ptr %return), !dbg !28 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: call void @_ZN16NaturallyAlignedC1Ev.carbon_thunk.(ptr %return), !dbg !29 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z4TakeI16NaturallyAlignedEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CExtraAlignment.Main(i32 %n) #0 !dbg !29 { +// CHECK:STDOUT: define void @_CExtraAlignment.Main(i32 %n) #0 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca [16 x i8], align 16, !dbg !32 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !32 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645"(ptr %a.var), !dbg !32 -// CHECK:STDOUT: %.loc33.n = getelementptr inbounds nuw [16 x i8], ptr %a.var, i32 0, i32 0, !dbg !33 -// CHECK:STDOUT: store i32 %n, ptr %.loc33.n, align 4, !dbg !33 -// CHECK:STDOUT: call void @_Z4TakeI14ExtraAlignmentEvRT_(ptr %a.var), !dbg !34 -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: %a.var = alloca [16 x i8], align 16, !dbg !33 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !33 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645"(ptr %a.var), !dbg !33 +// CHECK:STDOUT: %.loc33.n = getelementptr inbounds nuw [16 x i8], ptr %a.var, i32 0, i32 0, !dbg !34 +// CHECK:STDOUT: store i32 %n, ptr %.loc33.n, align 4, !dbg !34 +// CHECK:STDOUT: call void @_Z4TakeI14ExtraAlignmentEvRT_(ptr %a.var), !dbg !35 +// CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN14ExtraAlignmentC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !36 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !36 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !37 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !37 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp"(ptr sret([16 x i8]) %return) #2 !dbg !38 { +// CHECK:STDOUT: define void @"_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp"(ptr sret([16 x i8]) %return) #2 !dbg !39 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN14ExtraAlignmentC1Ev.carbon_thunk.(ptr %return), !dbg !39 -// CHECK:STDOUT: ret void, !dbg !39 +// CHECK:STDOUT: call void @_ZN14ExtraAlignmentC1Ev.carbon_thunk.(ptr %return), !dbg !40 +// CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z4TakeI14ExtraAlignmentEvRT_(ptr noundef nonnull align 16 dereferenceable(16)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPacked.Main(i32 %n) #0 !dbg !40 { +// CHECK:STDOUT: define void @_CPacked.Main(i32 %n) #0 !dbg !41 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca [4 x i8], align 1, !dbg !43 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !43 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a"(ptr %a.var), !dbg !43 -// CHECK:STDOUT: %.loc42.n = getelementptr inbounds nuw [4 x i8], ptr %a.var, i32 0, i32 0, !dbg !44 -// CHECK:STDOUT: store i32 %n, ptr %.loc42.n, align 4, !dbg !44 -// CHECK:STDOUT: call void @_Z4TakeI6PackedEvRT_(ptr %a.var), !dbg !45 -// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: %a.var = alloca [4 x i8], align 1, !dbg !44 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !44 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a"(ptr %a.var), !dbg !44 +// CHECK:STDOUT: %.loc42.n = getelementptr inbounds nuw [4 x i8], ptr %a.var, i32 0, i32 0, !dbg !45 +// CHECK:STDOUT: store i32 %n, ptr %.loc42.n, align 4, !dbg !45 +// CHECK:STDOUT: call void @_Z4TakeI6PackedEvRT_(ptr %a.var), !dbg !46 +// CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN6PackedC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !47 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !47 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !48 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !48 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !49 { +// CHECK:STDOUT: define void @"_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !50 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN6PackedC1Ev.carbon_thunk.(ptr %return), !dbg !50 -// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: call void @_ZN6PackedC1Ev.carbon_thunk.(ptr %return), !dbg !51 +// CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z4TakeI6PackedEvRT_(ptr noundef nonnull align 1 dereferenceable(4)) #3 @@ -156,21 +156,21 @@ fn Packed(n: i32) { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #4 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619"(ptr sret([4 x i8]) %return) #0 !dbg !51 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.c846b89dd79c7366.Core:NaturallyAligned.Cpp"(ptr %return), !dbg !53 -// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619"(ptr sret([4 x i8]) %return) #0 !dbg !52 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.c846b89dd79c7366.Core:NaturallyAligned.Cpp"(ptr %return), !dbg !54 +// CHECK:STDOUT: ret void, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645"(ptr sret([16 x i8]) %return) #0 !dbg !55 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp"(ptr %return), !dbg !56 -// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645"(ptr sret([16 x i8]) %return) #0 !dbg !56 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp"(ptr %return), !dbg !57 +// CHECK:STDOUT: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a"(ptr sret([4 x i8]) %return) #0 !dbg !58 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp"(ptr %return), !dbg !59 -// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a"(ptr sret([4 x i8]) %return) #0 !dbg !59 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp"(ptr %return), !dbg !60 +// CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -193,58 +193,59 @@ fn Packed(n: i32) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "NaturallyAligned", linkageName: "_CNaturallyAligned.Main", scope: null, file: !1, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 24, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 25, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 26, column: 3, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 23, column: 1, scope: !11) -// CHECK:STDOUT: !21 = !{!22, !22, i64 0} -// CHECK:STDOUT: !22 = !{!"p1 _ZTS16NaturallyAligned", !23, i64 0} -// CHECK:STDOUT: !23 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.c846b89dd79c7366.Core:NaturallyAligned.Cpp", scope: null, file: !1, line: 7, type: !25, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !26 = !{!27} -// CHECK:STDOUT: !27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !28 = !DILocation(line: 7, column: 8, scope: !24) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "ExtraAlignment", linkageName: "_CExtraAlignment.Main", scope: null, file: !1, line: 29, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) -// CHECK:STDOUT: !30 = !{!31} -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !14) -// CHECK:STDOUT: !32 = !DILocation(line: 30, column: 3, scope: !29) -// CHECK:STDOUT: !33 = !DILocation(line: 33, column: 3, scope: !29) -// CHECK:STDOUT: !34 = !DILocation(line: 34, column: 3, scope: !29) -// CHECK:STDOUT: !35 = !DILocation(line: 29, column: 1, scope: !29) -// CHECK:STDOUT: !36 = !{!37, !37, i64 0} -// CHECK:STDOUT: !37 = !{!"p1 _ZTS14ExtraAlignment", !23, i64 0} -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp", scope: null, file: !1, line: 11, type: !25, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !39 = !DILocation(line: 11, column: 20, scope: !38) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Packed", linkageName: "_CPacked.Main", scope: null, file: !1, line: 37, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !41) -// CHECK:STDOUT: !41 = !{!42} -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !14) -// CHECK:STDOUT: !43 = !DILocation(line: 38, column: 3, scope: !40) -// CHECK:STDOUT: !44 = !DILocation(line: 42, column: 3, scope: !40) -// CHECK:STDOUT: !45 = !DILocation(line: 43, column: 3, scope: !40) -// CHECK:STDOUT: !46 = !DILocation(line: 37, column: 1, scope: !40) -// CHECK:STDOUT: !47 = !{!48, !48, i64 0} -// CHECK:STDOUT: !48 = !{!"p1 _ZTS6Packed", !23, i64 0} -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp", scope: null, file: !1, line: 15, type: !25, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !50 = !DILocation(line: 15, column: 32, scope: !49) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619", scope: null, file: !52, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !52 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") -// CHECK:STDOUT: !53 = !DILocation(line: 9, column: 28, scope: !51) -// CHECK:STDOUT: !54 = !DILocation(line: 9, column: 21, scope: !51) -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645", scope: null, file: !52, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !56 = !DILocation(line: 9, column: 28, scope: !55) -// CHECK:STDOUT: !57 = !DILocation(line: 9, column: 21, scope: !55) -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a", scope: null, file: !52, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !59 = !DILocation(line: 9, column: 28, scope: !58) -// CHECK:STDOUT: !60 = !DILocation(line: 9, column: 21, scope: !58) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "NaturallyAligned", linkageName: "_CNaturallyAligned.Main", scope: null, file: !1, line: 23, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 24, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 25, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 26, column: 3, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 23, column: 1, scope: !12) +// CHECK:STDOUT: !22 = !{!23, !23, i64 0} +// CHECK:STDOUT: !23 = !{!"p1 _ZTS16NaturallyAligned", !24, i64 0} +// CHECK:STDOUT: !24 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.c846b89dd79c7366.Core:NaturallyAligned.Cpp", scope: null, file: !1, line: 7, type: !26, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !29 = !DILocation(line: 7, column: 8, scope: !25) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "ExtraAlignment", linkageName: "_CExtraAlignment.Main", scope: null, file: !1, line: 29, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !15) +// CHECK:STDOUT: !33 = !DILocation(line: 30, column: 3, scope: !30) +// CHECK:STDOUT: !34 = !DILocation(line: 33, column: 3, scope: !30) +// CHECK:STDOUT: !35 = !DILocation(line: 34, column: 3, scope: !30) +// CHECK:STDOUT: !36 = !DILocation(line: 29, column: 1, scope: !30) +// CHECK:STDOUT: !37 = !{!38, !38, i64 0} +// CHECK:STDOUT: !38 = !{!"p1 _ZTS14ExtraAlignment", !24, i64 0} +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.52e7708693d29223.Core:ExtraAlignment.Cpp", scope: null, file: !1, line: 11, type: !26, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !40 = !DILocation(line: 11, column: 20, scope: !39) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Packed", linkageName: "_CPacked.Main", scope: null, file: !1, line: 37, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !42) +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !15) +// CHECK:STDOUT: !44 = !DILocation(line: 38, column: 3, scope: !41) +// CHECK:STDOUT: !45 = !DILocation(line: 42, column: 3, scope: !41) +// CHECK:STDOUT: !46 = !DILocation(line: 43, column: 3, scope: !41) +// CHECK:STDOUT: !47 = !DILocation(line: 37, column: 1, scope: !41) +// CHECK:STDOUT: !48 = !{!49, !49, i64 0} +// CHECK:STDOUT: !49 = !{!"p1 _ZTS6Packed", !24, i64 0} +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.ca2b917a39954a06.Core:Packed.Cpp", scope: null, file: !1, line: 15, type: !26, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !51 = !DILocation(line: 15, column: 32, scope: !50) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.d4cda66b3640b619", scope: null, file: !53, line: 9, type: !26, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !53 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") +// CHECK:STDOUT: !54 = !DILocation(line: 9, column: 28, scope: !52) +// CHECK:STDOUT: !55 = !DILocation(line: 9, column: 21, scope: !52) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.34933c1c343bd645", scope: null, file: !53, line: 9, type: !26, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !57 = !DILocation(line: 9, column: 28, scope: !56) +// CHECK:STDOUT: !58 = !DILocation(line: 9, column: 21, scope: !56) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.3e10857902c69c1a", scope: null, file: !53, line: 9, type: !26, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !60 = !DILocation(line: 9, column: 28, scope: !59) +// CHECK:STDOUT: !61 = !DILocation(line: 9, column: 21, scope: !59) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/base.carbon b/toolchain/lower/testdata/interop/cpp/class/import/base.carbon index e4e9bca6d98fc..e08ed140f3ee2 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/base.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/base.carbon @@ -65,20 +65,20 @@ fn Call(b: Cpp.B*) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CConvertPtr.Main(ptr %p) #0 !dbg !11 { +// CHECK:STDOUT: define ptr @_CConvertPtr.Main(ptr %p) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_11.2.base = getelementptr inbounds nuw [8 x i8], ptr %p, i32 0, i32 0, !dbg !17 -// CHECK:STDOUT: ret ptr %.loc7_11.2.base, !dbg !17 +// CHECK:STDOUT: %.loc7_11.2.base = getelementptr inbounds nuw [8 x i8], ptr %p, i32 0, i32 0, !dbg !18 +// CHECK:STDOUT: ret ptr %.loc7_11.2.base, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CAcceptVal.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertVal.Main(ptr %b) #0 !dbg !18 { +// CHECK:STDOUT: define void @_CConvertVal.Main(ptr %b) #0 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc13_13.2.a = getelementptr inbounds nuw [4 x i8], ptr %b, i32 0, i32 0, !dbg !23 -// CHECK:STDOUT: call void @_CAcceptVal.Main(ptr %.loc13_13.2.a), !dbg !24 -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: %.loc13_13.2.a = getelementptr inbounds nuw [4 x i8], ptr %b, i32 0, i32 0, !dbg !24 +// CHECK:STDOUT: call void @_CAcceptVal.Main(ptr %.loc13_13.2.a), !dbg !25 +// CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -94,25 +94,26 @@ fn Call(b: Cpp.B*) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "ConvertPtr", linkageName: "_CConvertPtr.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "ConvertVal", linkageName: "_CConvertVal.Main", scope: null, file: !1, line: 12, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) -// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) -// CHECK:STDOUT: !20 = !{null, !14} -// CHECK:STDOUT: !21 = !{!22} -// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !18, type: !14) -// CHECK:STDOUT: !23 = !DILocation(line: 13, column: 13, scope: !18) -// CHECK:STDOUT: !24 = !DILocation(line: 13, column: 3, scope: !18) -// CHECK:STDOUT: !25 = !DILocation(line: 12, column: 1, scope: !18) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "ConvertPtr", linkageName: "_CConvertPtr.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "ConvertVal", linkageName: "_CConvertVal.Main", scope: null, file: !1, line: 12, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !15} +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !19, type: !15) +// CHECK:STDOUT: !24 = !DILocation(line: 13, column: 13, scope: !19) +// CHECK:STDOUT: !25 = !DILocation(line: 13, column: 3, scope: !19) +// CHECK:STDOUT: !26 = !DILocation(line: 12, column: 1, scope: !19) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'access_field.carbon' @@ -121,12 +122,12 @@ fn Call(b: Cpp.B*) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessVal.Main(ptr %b) #0 !dbg !11 { +// CHECK:STDOUT: define i32 @_CAccessVal.Main(ptr %b) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_11.2.a = getelementptr inbounds nuw [4 x i8], ptr %b, i32 0, i32 0, !dbg !18 -// CHECK:STDOUT: %.loc7_11.4.a = getelementptr inbounds nuw [4 x i8], ptr %.loc7_11.2.a, i32 0, i32 0, !dbg !18 -// CHECK:STDOUT: %.loc7_11.5 = load i32, ptr %.loc7_11.4.a, align 4, !dbg !18 -// CHECK:STDOUT: ret i32 %.loc7_11.5, !dbg !19 +// CHECK:STDOUT: %.loc7_11.2.a = getelementptr inbounds nuw [4 x i8], ptr %b, i32 0, i32 0, !dbg !19 +// CHECK:STDOUT: %.loc7_11.4.a = getelementptr inbounds nuw [4 x i8], ptr %.loc7_11.2.a, i32 0, i32 0, !dbg !19 +// CHECK:STDOUT: %.loc7_11.5 = load i32, ptr %.loc7_11.4.a, align 4, !dbg !19 +// CHECK:STDOUT: ret i32 %.loc7_11.5, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -142,19 +143,20 @@ fn Call(b: Cpp.B*) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "AccessVal", linkageName: "_CAccessVal.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !15} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !16 = !{!17} -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !11, type: !15) -// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "AccessVal", linkageName: "_CAccessVal.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !17) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !16} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !17 = !{!18} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !12, type: !16) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 7, column: 3, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_method.carbon' @@ -165,18 +167,18 @@ fn Call(b: Cpp.B*) { // CHECK:STDOUT: $_ZN1A1fEv = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall.Main(ptr %b) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CCall.Main(ptr %b) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_4.3.a = getelementptr inbounds nuw [4 x i8], ptr %b, i32 0, i32 0, !dbg !17 -// CHECK:STDOUT: call void @_ZN1A1fEv(ptr %.loc7_4.3.a), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: %.loc7_4.3.a = getelementptr inbounds nuw [4 x i8], ptr %b, i32 0, i32 0, !dbg !18 +// CHECK:STDOUT: call void @_ZN1A1fEv(ptr %.loc7_4.3.a), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1A1fEv(ptr noundef nonnull align 4 dereferenceable(4) %this) #1 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !19 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !20 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -195,19 +197,20 @@ fn Call(b: Cpp.B*) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !19 = !{!20, !20, i64 0} -// CHECK:STDOUT: !20 = !{!"p1 _ZTS1A", !21, i64 0} -// CHECK:STDOUT: !21 = !{!"any pointer", !9, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !20 = !{!21, !21, i64 0} +// CHECK:STDOUT: !21 = !{!"p1 _ZTS1A", !22, i64 0} +// CHECK:STDOUT: !22 = !{!"any pointer", !10, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon b/toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon index 99fb5346622ae..7040776259e2e 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon @@ -178,39 +178,39 @@ fn Four() { // CHECK:STDOUT: $_ZN1CC2Ev = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_26.1.temp = alloca [8 x i8], align 4, !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_26.1.temp), !dbg !14 -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %.loc7_26.1.temp), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: %.loc7_26.1.temp = alloca [8 x i8], align 4, !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_26.1.temp), !dbg !15 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %.loc7_26.1.temp), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !16 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17 // CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !19 { +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_19.2.temp = alloca [8 x i8], align 4, !dbg !20 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_19.2.temp), !dbg !20 -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr %.loc11_19.2.temp), !dbg !20 -// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: %.loc11_19.2.temp = alloca [8 x i8], align 4, !dbg !21 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_19.2.temp), !dbg !21 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr %.loc11_19.2.temp), !dbg !21 +// CHECK:STDOUT: ret void, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !16 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17 // CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -222,12 +222,12 @@ fn Four() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1CC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %x_ = getelementptr inbounds nuw %class.C, ptr %this1, i32 0, i32 0 -// CHECK:STDOUT: store i32 8, ptr %x_, align 4, !tbaa !22 +// CHECK:STDOUT: store i32 8, ptr %x_, align 4, !tbaa !23 // CHECK:STDOUT: %y_ = getelementptr inbounds nuw %class.C, ptr %this1, i32 0, i32 1 -// CHECK:STDOUT: store i32 9, ptr %y_, align 4, !tbaa !24 +// CHECK:STDOUT: store i32 9, ptr %y_, align 4, !tbaa !25 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -250,24 +250,25 @@ fn Four() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 18, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !16 = !{!17, !17, i64 0} -// CHECK:STDOUT: !17 = !{!"p1 _ZTS1C", !18, i64 0} -// CHECK:STDOUT: !18 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !1, line: 10, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !20 = !DILocation(line: 11, column: 18, scope: !19) -// CHECK:STDOUT: !21 = !DILocation(line: 10, column: 1, scope: !19) -// CHECK:STDOUT: !22 = !{!23, !8, i64 0} -// CHECK:STDOUT: !23 = !{!"_ZTS1C", !8, i64 0, !8, i64 4} -// CHECK:STDOUT: !24 = !{!23, !8, i64 4} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 18, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !17 = !{!18, !18, i64 0} +// CHECK:STDOUT: !18 = !{!"p1 _ZTS1C", !19, i64 0} +// CHECK:STDOUT: !19 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !1, line: 10, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !21 = !DILocation(line: 11, column: 18, scope: !20) +// CHECK:STDOUT: !22 = !DILocation(line: 10, column: 1, scope: !20) +// CHECK:STDOUT: !23 = !{!24, !9, i64 0} +// CHECK:STDOUT: !24 = !{!"_ZTS1C", !9, i64 0, !9, i64 4} +// CHECK:STDOUT: !25 = !{!24, !9, i64 4} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'implicit_default.carbon' @@ -280,50 +281,50 @@ fn Four() { // CHECK:STDOUT: $_ZN1CC2Ev = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [8 x i8], align 4, !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !14 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %_.var), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: %_.var = alloca [8 x i8], align 4, !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !15 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %_.var), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !16 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17 // CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret([8 x i8]) %return) #2 !dbg !19 { +// CHECK:STDOUT: define void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret([8 x i8]) %return) #2 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !24 -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !25 +// CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret([8 x i8]) %return) #0 !dbg !25 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !27 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret([8 x i8]) %return) #0 !dbg !26 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !28 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1CC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %this) unnamed_addr #4 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %x_ = getelementptr inbounds nuw %class.C, ptr %this1, i32 0, i32 0 -// CHECK:STDOUT: store i32 8, ptr %x_, align 4, !tbaa !29 +// CHECK:STDOUT: store i32 8, ptr %x_, align 4, !tbaa !30 // CHECK:STDOUT: %y_ = getelementptr inbounds nuw %class.C, ptr %this1, i32 0, i32 1 -// CHECK:STDOUT: store i32 9, ptr %y_, align 4, !tbaa !31 +// CHECK:STDOUT: store i32 9, ptr %y_, align 4, !tbaa !32 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -344,31 +345,32 @@ fn Four() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !16 = !{!17, !17, i64 0} -// CHECK:STDOUT: !17 = !{!"p1 _ZTS1C", !18, i64 0} -// CHECK:STDOUT: !18 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !20, line: 4, type: !21, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !20 = !DIFile(filename: "./default.h", directory: "") -// CHECK:STDOUT: !21 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !22 = !{!23} -// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !24 = !DILocation(line: 4, column: 3, scope: !19) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !26, line: 9, type: !21, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !26 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") -// CHECK:STDOUT: !27 = !DILocation(line: 9, column: 28, scope: !25) -// CHECK:STDOUT: !28 = !DILocation(line: 9, column: 21, scope: !25) -// CHECK:STDOUT: !29 = !{!30, !8, i64 0} -// CHECK:STDOUT: !30 = !{!"_ZTS1C", !8, i64 0, !8, i64 4} -// CHECK:STDOUT: !31 = !{!30, !8, i64 4} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !17 = !{!18, !18, i64 0} +// CHECK:STDOUT: !18 = !{!"p1 _ZTS1C", !19, i64 0} +// CHECK:STDOUT: !19 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !21, line: 4, type: !22, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !21 = !DIFile(filename: "./default.h", directory: "") +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !25 = !DILocation(line: 4, column: 3, scope: !20) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !27, line: 9, type: !22, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !27 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") +// CHECK:STDOUT: !28 = !DILocation(line: 9, column: 28, scope: !26) +// CHECK:STDOUT: !29 = !DILocation(line: 9, column: 21, scope: !26) +// CHECK:STDOUT: !30 = !{!31, !9, i64 0} +// CHECK:STDOUT: !31 = !{!"_ZTS1C", !9, i64 0, !9, i64 4} +// CHECK:STDOUT: !32 = !{!31, !9, i64 4} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'defaulted_default.carbon' @@ -384,80 +386,80 @@ fn Four() { // CHECK:STDOUT: $_ZN26ExplicitlyDefaultedDefaultC2Ev = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc8_65.1.temp = alloca [4 x i8], align 4, !dbg !14 -// CHECK:STDOUT: %_.var.loc9 = alloca [4 x i8], align 4, !dbg !15 -// CHECK:STDOUT: %.loc12_65.1.temp = alloca [4 x i8], align 4, !dbg !16 -// CHECK:STDOUT: %_.var.loc13 = alloca [4 x i8], align 4, !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_65.1.temp), !dbg !14 -// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc8_65.1.temp), !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc9), !dbg !15 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9"(ptr %_.var.loc9), !dbg !15 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_65.1.temp), !dbg !16 -// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc12_65.1.temp), !dbg !16 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc13), !dbg !17 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271"(ptr %_.var.loc13), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: %.loc8_65.1.temp = alloca [4 x i8], align 4, !dbg !15 +// CHECK:STDOUT: %_.var.loc9 = alloca [4 x i8], align 4, !dbg !16 +// CHECK:STDOUT: %.loc12_65.1.temp = alloca [4 x i8], align 4, !dbg !17 +// CHECK:STDOUT: %_.var.loc13 = alloca [4 x i8], align 4, !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_65.1.temp), !dbg !15 +// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc8_65.1.temp), !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc9), !dbg !16 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9"(ptr %_.var.loc9), !dbg !16 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_65.1.temp), !dbg !17 +// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc12_65.1.temp), !dbg !17 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc13), !dbg !18 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271"(ptr %_.var.loc13), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !19 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !19 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !20 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !20 // CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #0 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !22 { +// CHECK:STDOUT: define void @"_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !23 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !27 -// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !28 +// CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !28 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !28 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !29 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !29 // CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #0 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !30 { +// CHECK:STDOUT: define void @"_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !31 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !31 -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !32 +// CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9"(ptr sret([4 x i8]) %return) #0 !dbg !32 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr %return), !dbg !34 -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9"(ptr sret([4 x i8]) %return) #0 !dbg !33 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr %return), !dbg !35 +// CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271"(ptr sret([4 x i8]) %return) #0 !dbg !36 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp"(ptr %return), !dbg !37 -// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271"(ptr sret([4 x i8]) %return) #0 !dbg !37 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp"(ptr %return), !dbg !38 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN26ImplicitlyDefaultedDefaultC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %this) unnamed_addr #4 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !19 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !20 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %x_ = getelementptr inbounds nuw %struct.ImplicitlyDefaultedDefault, ptr %this1, i32 0, i32 0 -// CHECK:STDOUT: store i32 1, ptr %x_, align 4, !tbaa !39 +// CHECK:STDOUT: store i32 1, ptr %x_, align 4, !tbaa !40 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -465,10 +467,10 @@ fn Four() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN26ExplicitlyDefaultedDefaultC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %this) unnamed_addr #5 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !28 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !29 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %x_ = getelementptr inbounds nuw %struct.ExplicitlyDefaultedDefault, ptr %this1, i32 0, i32 0 -// CHECK:STDOUT: store i32 1, ptr %x_, align 4, !tbaa !41 +// CHECK:STDOUT: store i32 1, ptr %x_, align 4, !tbaa !42 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -493,42 +495,43 @@ fn Four() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 8, column: 7, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 12, column: 7, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 13, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !19 = !{!20, !20, i64 0} -// CHECK:STDOUT: !20 = !{!"p1 _ZTS26ImplicitlyDefaultedDefault", !21, i64 0} -// CHECK:STDOUT: !21 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp", scope: null, file: !23, line: 2, type: !24, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !23 = !DIFile(filename: "./defaulted_default.h", directory: "") -// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) -// CHECK:STDOUT: !25 = !{!26} -// CHECK:STDOUT: !26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !27 = !DILocation(line: 2, column: 8, scope: !22) -// CHECK:STDOUT: !28 = !{!29, !29, i64 0} -// CHECK:STDOUT: !29 = !{!"p1 _ZTS26ExplicitlyDefaultedDefault", !21, i64 0} -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp", scope: null, file: !23, line: 7, type: !24, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !31 = !DILocation(line: 7, column: 3, scope: !30) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9", scope: null, file: !33, line: 9, type: !24, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !33 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") -// CHECK:STDOUT: !34 = !DILocation(line: 9, column: 28, scope: !32) -// CHECK:STDOUT: !35 = !DILocation(line: 9, column: 21, scope: !32) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271", scope: null, file: !33, line: 9, type: !24, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !37 = !DILocation(line: 9, column: 28, scope: !36) -// CHECK:STDOUT: !38 = !DILocation(line: 9, column: 21, scope: !36) -// CHECK:STDOUT: !39 = !{!40, !8, i64 0} -// CHECK:STDOUT: !40 = !{!"_ZTS26ImplicitlyDefaultedDefault", !8, i64 0} -// CHECK:STDOUT: !41 = !{!42, !8, i64 0} -// CHECK:STDOUT: !42 = !{!"_ZTS26ExplicitlyDefaultedDefault", !8, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 7, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 7, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 13, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !20 = !{!21, !21, i64 0} +// CHECK:STDOUT: !21 = !{!"p1 _ZTS26ImplicitlyDefaultedDefault", !22, i64 0} +// CHECK:STDOUT: !22 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp", scope: null, file: !24, line: 2, type: !25, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !24 = !DIFile(filename: "./defaulted_default.h", directory: "") +// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !28 = !DILocation(line: 2, column: 8, scope: !23) +// CHECK:STDOUT: !29 = !{!30, !30, i64 0} +// CHECK:STDOUT: !30 = !{!"p1 _ZTS26ExplicitlyDefaultedDefault", !22, i64 0} +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp", scope: null, file: !24, line: 7, type: !25, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !32 = !DILocation(line: 7, column: 3, scope: !31) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9", scope: null, file: !34, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !34 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") +// CHECK:STDOUT: !35 = !DILocation(line: 9, column: 28, scope: !33) +// CHECK:STDOUT: !36 = !DILocation(line: 9, column: 21, scope: !33) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271", scope: null, file: !34, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !38 = !DILocation(line: 9, column: 28, scope: !37) +// CHECK:STDOUT: !39 = !DILocation(line: 9, column: 21, scope: !37) +// CHECK:STDOUT: !40 = !{!41, !9, i64 0} +// CHECK:STDOUT: !41 = !{!"_ZTS26ImplicitlyDefaultedDefault", !9, i64 0} +// CHECK:STDOUT: !42 = !{!43, !9, i64 0} +// CHECK:STDOUT: !43 = !{!"_ZTS26ExplicitlyDefaultedDefault", !9, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_copy.carbon' @@ -537,12 +540,12 @@ fn Four() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCopy.Main(ptr sret([4 x i8]) %return, ptr %c) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CCopy.Main(ptr sret([4 x i8]) %return, ptr %c) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_10.1.temp = alloca [4 x i8], align 4, !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_10.1.temp), !dbg !17 -// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %c, ptr %return), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: %.loc7_10.1.temp = alloca [4 x i8], align 4, !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_10.1.temp), !dbg !18 +// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %c, ptr %return), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -550,19 +553,19 @@ fn Four() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !19 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !19 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !19 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !19 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !20 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !20 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !20 // CHECK:STDOUT: call void @_ZN4CopyC1ERKS_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Copy.58fe21e3ef78b0d7.Core:Copy.Cpp"(ptr sret([4 x i8]) %return, ptr %self) #2 !dbg !22 { +// CHECK:STDOUT: define void @"_COp:thunk:Copy.58fe21e3ef78b0d7.Core:Copy.Cpp"(ptr sret([4 x i8]) %return, ptr %self) #2 !dbg !23 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !26 -// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !27 +// CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -587,26 +590,27 @@ fn Four() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Copy", linkageName: "_CCopy.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !{!20, !20, i64 0} -// CHECK:STDOUT: !20 = !{!"p1 _ZTS4Copy", !21, i64 0} -// CHECK:STDOUT: !21 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.58fe21e3ef78b0d7.Core:Copy.Cpp", scope: null, file: !23, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24) -// CHECK:STDOUT: !23 = !DIFile(filename: "./copy.h", directory: "") -// CHECK:STDOUT: !24 = !{!25} -// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !22, type: !14) -// CHECK:STDOUT: !26 = !DILocation(line: 5, column: 3, scope: !22) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Copy", linkageName: "_CCopy.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !{!21, !21, i64 0} +// CHECK:STDOUT: !21 = !{!"p1 _ZTS4Copy", !22, i64 0} +// CHECK:STDOUT: !22 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.58fe21e3ef78b0d7.Core:Copy.Cpp", scope: null, file: !24, line: 5, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !25) +// CHECK:STDOUT: !24 = !DIFile(filename: "./copy.h", directory: "") +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !23, type: !15) +// CHECK:STDOUT: !27 = !DILocation(line: 5, column: 3, scope: !23) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_c1_in_thunk.carbon' @@ -638,20 +642,20 @@ fn Four() { // CHECK:STDOUT: @_ZTS4Base = linkonce_odr dso_local constant [6 x i8] c"4Base\00", comdat, align 1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_44.1.temp = alloca [8 x i8], align 8, !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_44.1.temp), !dbg !14 -// CHECK:STDOUT: call void @_ZN7DerivedC1Ev.carbon_thunk.(ptr %.loc7_44.1.temp), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: %.loc7_44.1.temp = alloca [8 x i8], align 8, !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_44.1.temp), !dbg !15 +// CHECK:STDOUT: call void @_ZN7DerivedC1Ev.carbon_thunk.(ptr %.loc7_44.1.temp), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN7DerivedC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !16 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17 // CHECK:STDOUT: call void @_ZN7DerivedC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #0 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -663,9 +667,9 @@ fn Four() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN7DerivedC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr] }, ptr @_ZTV7Derived, i32 0, i32 0, i32 3), ptr %this1, align 8, !tbaa !19 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr] }, ptr @_ZTV7Derived, i32 0, i32 0, i32 3), ptr %this1, align 8, !tbaa !20 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -685,20 +689,21 @@ fn Four() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 24, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !16 = !{!17, !17, i64 0} -// CHECK:STDOUT: !17 = !{!"p1 _ZTS7Derived", !18, i64 0} -// CHECK:STDOUT: !18 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !19 = !{!20, !20, i64 0} -// CHECK:STDOUT: !20 = !{!"vtable pointer", !10, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 24, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !17 = !{!18, !18, i64 0} +// CHECK:STDOUT: !18 = !{!"p1 _ZTS7Derived", !19, i64 0} +// CHECK:STDOUT: !19 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !20 = !{!21, !21, i64 0} +// CHECK:STDOUT: !21 = !{!"vtable pointer", !11, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_multi_argument.carbon' @@ -715,23 +720,23 @@ fn Four() { // CHECK:STDOUT: $_ZN1CC2Eiiii = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CZero.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CZero.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_26.1.temp = alloca [1 x i8], align 1, !dbg !14 -// CHECK:STDOUT: %.loc8_19.2.temp = alloca [1 x i8], align 1, !dbg !15 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_26.1.temp), !dbg !14 -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %.loc7_26.1.temp), !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_19.2.temp), !dbg !15 -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr %.loc8_19.2.temp), !dbg !15 -// CHECK:STDOUT: ret void, !dbg !16 +// CHECK:STDOUT: %.loc7_26.1.temp = alloca [1 x i8], align 1, !dbg !15 +// CHECK:STDOUT: %.loc8_19.2.temp = alloca [1 x i8], align 1, !dbg !16 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_26.1.temp), !dbg !15 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %.loc7_26.1.temp), !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_19.2.temp), !dbg !16 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr %.loc8_19.2.temp), !dbg !16 +// CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !18 // CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -740,25 +745,25 @@ fn Four() { // CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !18 // CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_COne.Main() #0 !dbg !20 { +// CHECK:STDOUT: define void @_COne.Main() #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc12_27.1.temp = alloca [1 x i8], align 1, !dbg !21 -// CHECK:STDOUT: %.loc13_18.1.temp = alloca [1 x i8], align 1, !dbg !22 -// CHECK:STDOUT: %.loc14_21.2.temp = alloca [1 x i8], align 1, !dbg !23 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_27.1.temp), !dbg !21 -// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk._(i32 1, ptr %.loc12_27.1.temp), !dbg !21 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_18.1.temp), !dbg !22 -// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk._(i32 2, ptr %.loc13_18.1.temp), !dbg !22 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_21.2.temp), !dbg !23 -// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk_tuple._(i32 3, ptr %.loc14_21.2.temp), !dbg !23 -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: %.loc12_27.1.temp = alloca [1 x i8], align 1, !dbg !22 +// CHECK:STDOUT: %.loc13_18.1.temp = alloca [1 x i8], align 1, !dbg !23 +// CHECK:STDOUT: %.loc14_21.2.temp = alloca [1 x i8], align 1, !dbg !24 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_27.1.temp), !dbg !22 +// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk._(i32 1, ptr %.loc12_27.1.temp), !dbg !22 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_18.1.temp), !dbg !23 +// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk._(i32 2, ptr %.loc13_18.1.temp), !dbg !23 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_21.2.temp), !dbg !24 +// CHECK:STDOUT: call void @_ZN1CC1Ei.carbon_thunk_tuple._(i32 3, ptr %.loc14_21.2.temp), !dbg !24 +// CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -766,10 +771,10 @@ fn Four() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !26 // CHECK:STDOUT: call void @_ZN1CC2Ei(ptr noundef nonnull align 1 dereferenceable(1) %1, i32 noundef %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -779,24 +784,24 @@ fn Four() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !26 // CHECK:STDOUT: call void @_ZN1CC2Ei(ptr noundef nonnull align 1 dereferenceable(1) %1, i32 noundef %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTwo.Main() #0 !dbg !25 { +// CHECK:STDOUT: define void @_CTwo.Main() #0 !dbg !27 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_30.1.temp = alloca [1 x i8], align 1, !dbg !26 -// CHECK:STDOUT: %.loc19_23.2.temp = alloca [1 x i8], align 1, !dbg !27 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_30.1.temp), !dbg !26 -// CHECK:STDOUT: call void @_ZN1CC1Eii.carbon_thunk.__(i32 1, i32 2, ptr %.loc18_30.1.temp), !dbg !26 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_23.2.temp), !dbg !27 -// CHECK:STDOUT: call void @_ZN1CC1Eii.carbon_thunk_tuple.__(i32 3, i32 4, ptr %.loc19_23.2.temp), !dbg !27 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: %.loc18_30.1.temp = alloca [1 x i8], align 1, !dbg !28 +// CHECK:STDOUT: %.loc19_23.2.temp = alloca [1 x i8], align 1, !dbg !29 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_30.1.temp), !dbg !28 +// CHECK:STDOUT: call void @_ZN1CC1Eii.carbon_thunk.__(i32 1, i32 2, ptr %.loc18_30.1.temp), !dbg !28 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_23.2.temp), !dbg !29 +// CHECK:STDOUT: call void @_ZN1CC1Eii.carbon_thunk_tuple.__(i32 3, i32 4, ptr %.loc19_23.2.temp), !dbg !29 +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -805,12 +810,12 @@ fn Four() { // CHECK:STDOUT: %.addr = alloca i32, align 4 // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !26 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !26 // CHECK:STDOUT: call void @_ZN1CC2Eii(ptr noundef nonnull align 1 dereferenceable(1) %2, i32 noundef %3, i32 noundef %4) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -821,26 +826,26 @@ fn Four() { // CHECK:STDOUT: %.addr = alloca i32, align 4 // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !26 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !26 // CHECK:STDOUT: call void @_ZN1CC2Eii(ptr noundef nonnull align 1 dereferenceable(1) %2, i32 noundef %3, i32 noundef %4) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CThree.Main() #0 !dbg !29 { +// CHECK:STDOUT: define void @_CThree.Main() #0 !dbg !31 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc23_33.1.temp = alloca [1 x i8], align 1, !dbg !30 -// CHECK:STDOUT: %.loc24_26.2.temp = alloca [1 x i8], align 1, !dbg !31 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_33.1.temp), !dbg !30 -// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk.___(i32 1, i32 2, i32 3, ptr %.loc23_33.1.temp), !dbg !30 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_26.2.temp), !dbg !31 -// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk_tuple.___(i32 4, i32 5, i32 6, ptr %.loc24_26.2.temp), !dbg !31 -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: %.loc23_33.1.temp = alloca [1 x i8], align 1, !dbg !32 +// CHECK:STDOUT: %.loc24_26.2.temp = alloca [1 x i8], align 1, !dbg !33 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_33.1.temp), !dbg !32 +// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk.___(i32 1, i32 2, i32 3, ptr %.loc23_33.1.temp), !dbg !32 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_26.2.temp), !dbg !33 +// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk_tuple.___(i32 4, i32 5, i32 6, ptr %.loc24_26.2.temp), !dbg !33 +// CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -850,14 +855,14 @@ fn Four() { // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !7 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %3 = load ptr, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !26 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %3 = load ptr, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !26 +// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !26 // CHECK:STDOUT: call void @_ZN1CC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef 0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -869,28 +874,28 @@ fn Four() { // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !7 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %3 = load ptr, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !26 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %3 = load ptr, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !26 +// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !26 // CHECK:STDOUT: call void @_ZN1CC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef 0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CFour.Main() #0 !dbg !33 { +// CHECK:STDOUT: define void @_CFour.Main() #0 !dbg !35 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc28_36.1.temp = alloca [1 x i8], align 1, !dbg !34 -// CHECK:STDOUT: %.loc29_29.2.temp = alloca [1 x i8], align 1, !dbg !35 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc28_36.1.temp), !dbg !34 -// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk.____(i32 1, i32 2, i32 3, i32 4, ptr %.loc28_36.1.temp), !dbg !34 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_29.2.temp), !dbg !35 -// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk_tuple.____(i32 5, i32 6, i32 7, i32 8, ptr %.loc29_29.2.temp), !dbg !35 -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: %.loc28_36.1.temp = alloca [1 x i8], align 1, !dbg !36 +// CHECK:STDOUT: %.loc29_29.2.temp = alloca [1 x i8], align 1, !dbg !37 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc28_36.1.temp), !dbg !36 +// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk.____(i32 1, i32 2, i32 3, i32 4, ptr %.loc28_36.1.temp), !dbg !36 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_29.2.temp), !dbg !37 +// CHECK:STDOUT: call void @_ZN1CC1Eiiii.carbon_thunk_tuple.____(i32 5, i32 6, i32 7, i32 8, ptr %.loc29_29.2.temp), !dbg !37 +// CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -901,16 +906,16 @@ fn Four() { // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %.addr3 = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !7 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %4 = load ptr, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %5 = load i32, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !7 -// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !26 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %4 = load ptr, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %5 = load i32, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !26 +// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !26 +// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !26 // CHECK:STDOUT: call void @_ZN1CC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -923,16 +928,16 @@ fn Four() { // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %.addr3 = alloca i32, align 4 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !7 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %4 = load ptr, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %5 = load i32, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !7 -// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !26 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %4 = load ptr, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %5 = load i32, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !26 +// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !26 +// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !26 // CHECK:STDOUT: call void @_ZN1CC2Eiiii(ptr noundef nonnull align 1 dereferenceable(1) %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -944,7 +949,7 @@ fn Four() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1CC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !18 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -954,8 +959,8 @@ fn Four() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr = alloca i32, align 4 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !18 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !26 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -966,9 +971,9 @@ fn Four() { // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr = alloca i32, align 4 // CHECK:STDOUT: %.addr1 = alloca i32, align 4 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !7 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !18 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !26 // CHECK:STDOUT: %this2 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -981,11 +986,11 @@ fn Four() { // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %.addr3 = alloca i32, align 4 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !7 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !18 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !26 +// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !26 // CHECK:STDOUT: %this4 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -1010,34 +1015,36 @@ fn Four() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Zero", linkageName: "_CZero.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 18, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 18, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !17 = !{!18, !18, i64 0} -// CHECK:STDOUT: !18 = !{!"p1 _ZTS1C", !19, i64 0} -// CHECK:STDOUT: !19 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "One", linkageName: "_COne.Main", scope: null, file: !1, line: 11, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !21 = !DILocation(line: 12, column: 18, scope: !20) -// CHECK:STDOUT: !22 = !DILocation(line: 13, column: 18, scope: !20) -// CHECK:STDOUT: !23 = !DILocation(line: 14, column: 18, scope: !20) -// CHECK:STDOUT: !24 = !DILocation(line: 11, column: 1, scope: !20) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Two", linkageName: "_CTwo.Main", scope: null, file: !1, line: 17, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !26 = !DILocation(line: 18, column: 18, scope: !25) -// CHECK:STDOUT: !27 = !DILocation(line: 19, column: 18, scope: !25) -// CHECK:STDOUT: !28 = !DILocation(line: 17, column: 1, scope: !25) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Three", linkageName: "_CThree.Main", scope: null, file: !1, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !30 = !DILocation(line: 23, column: 18, scope: !29) -// CHECK:STDOUT: !31 = !DILocation(line: 24, column: 18, scope: !29) -// CHECK:STDOUT: !32 = !DILocation(line: 22, column: 1, scope: !29) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Four", linkageName: "_CFour.Main", scope: null, file: !1, line: 27, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !34 = !DILocation(line: 28, column: 18, scope: !33) -// CHECK:STDOUT: !35 = !DILocation(line: 29, column: 18, scope: !33) -// CHECK:STDOUT: !36 = !DILocation(line: 27, column: 1, scope: !33) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Zero", linkageName: "_CZero.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 18, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 18, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !18 = !{!19, !19, i64 0} +// CHECK:STDOUT: !19 = !{!"p1 _ZTS1C", !20, i64 0} +// CHECK:STDOUT: !20 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "One", linkageName: "_COne.Main", scope: null, file: !1, line: 11, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !22 = !DILocation(line: 12, column: 18, scope: !21) +// CHECK:STDOUT: !23 = !DILocation(line: 13, column: 18, scope: !21) +// CHECK:STDOUT: !24 = !DILocation(line: 14, column: 18, scope: !21) +// CHECK:STDOUT: !25 = !DILocation(line: 11, column: 1, scope: !21) +// CHECK:STDOUT: !26 = !{!9, !9, i64 0} +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Two", linkageName: "_CTwo.Main", scope: null, file: !1, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !28 = !DILocation(line: 18, column: 18, scope: !27) +// CHECK:STDOUT: !29 = !DILocation(line: 19, column: 18, scope: !27) +// CHECK:STDOUT: !30 = !DILocation(line: 17, column: 1, scope: !27) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Three", linkageName: "_CThree.Main", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !32 = !DILocation(line: 23, column: 18, scope: !31) +// CHECK:STDOUT: !33 = !DILocation(line: 24, column: 18, scope: !31) +// CHECK:STDOUT: !34 = !DILocation(line: 22, column: 1, scope: !31) +// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Four", linkageName: "_CFour.Main", scope: null, file: !1, line: 27, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !36 = !DILocation(line: 28, column: 18, scope: !35) +// CHECK:STDOUT: !37 = !DILocation(line: 29, column: 18, scope: !35) +// CHECK:STDOUT: !38 = !DILocation(line: 27, column: 1, scope: !35) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/conversion.carbon b/toolchain/lower/testdata/interop/cpp/class/import/conversion.carbon index bbe2d7403fc72..3d123bcb3c11b 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/conversion.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/conversion.carbon @@ -85,13 +85,13 @@ fn ConvertToValue(b: Cpp.B) { // CHECK:STDOUT: %struct.A = type { i32 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca [4 x i8], align 4, !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !17 -// CHECK:STDOUT: call void @_ZNK1Bcv1AEv.carbon_thunk._(ptr %b, ptr %a.var), !dbg !17 -// CHECK:STDOUT: call void @_ZN1AD1Ev(ptr %a.var), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: %a.var = alloca [4 x i8], align 4, !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !18 +// CHECK:STDOUT: call void @_ZNK1Bcv1AEv.carbon_thunk._(ptr %b, ptr %a.var), !dbg !18 +// CHECK:STDOUT: call void @_ZN1AD1Ev(ptr %a.var), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -99,10 +99,10 @@ fn ConvertToValue(b: Cpp.B) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !19 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !22 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !22 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !19, !nonnull !24 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !20, !nonnull !25 // CHECK:STDOUT: call void @_ZNK1Bcv1AEv(ptr dead_on_unwind writable sret(%struct.A) align 4 %0, ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -111,13 +111,13 @@ fn ConvertToValue(b: Cpp.B) { // CHECK:STDOUT: declare void @_ZN1AD1Ev(ptr noundef nonnull align 4 dead_on_return(4) dereferenceable(4)) unnamed_addr #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !25 { +// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc20_25.1.temp = alloca [4 x i8], align 4, !dbg !28 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !28 -// CHECK:STDOUT: call void @_ZNK1Bcv1AEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !28 -// CHECK:STDOUT: call void @_ZN1AD1Ev(ptr %.loc20_25.1.temp), !dbg !28 -// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: %.loc20_25.1.temp = alloca [4 x i8], align 4, !dbg !29 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !29 +// CHECK:STDOUT: call void @_ZNK1Bcv1AEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !29 +// CHECK:STDOUT: call void @_ZN1AD1Ev(ptr %.loc20_25.1.temp), !dbg !29 +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -145,29 +145,30 @@ fn ConvertToValue(b: Cpp.B) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !1, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 16, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 15, column: 1, scope: !11) -// CHECK:STDOUT: !19 = !{!20, !20, i64 0} -// CHECK:STDOUT: !20 = !{!"p1 _ZTS1B", !21, i64 0} -// CHECK:STDOUT: !21 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !22 = !{!23, !23, i64 0} -// CHECK:STDOUT: !23 = !{!"p1 _ZTS1A", !21, i64 0} -// CHECK:STDOUT: !24 = !{} -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !1, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) -// CHECK:STDOUT: !26 = !{!27} -// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !14) -// CHECK:STDOUT: !28 = !DILocation(line: 20, column: 25, scope: !25) -// CHECK:STDOUT: !29 = !DILocation(line: 19, column: 1, scope: !25) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !1, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 16, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 15, column: 1, scope: !12) +// CHECK:STDOUT: !20 = !{!21, !21, i64 0} +// CHECK:STDOUT: !21 = !{!"p1 _ZTS1B", !22, i64 0} +// CHECK:STDOUT: !22 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !23 = !{!24, !24, i64 0} +// CHECK:STDOUT: !24 = !{!"p1 _ZTS1A", !22, i64 0} +// CHECK:STDOUT: !25 = !{} +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !1, line: 19, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !15) +// CHECK:STDOUT: !29 = !DILocation(line: 20, column: 25, scope: !26) +// CHECK:STDOUT: !30 = !DILocation(line: 19, column: 1, scope: !26) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'class_to_enum.carbon' @@ -176,15 +177,15 @@ fn ConvertToValue(b: Cpp.B) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %s.var = alloca i16, align 2, !dbg !17 -// CHECK:STDOUT: %i.var = alloca i16, align 2, !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %s.var), !dbg !17 -// CHECK:STDOUT: call void @_ZNK1Bcv1SEv.carbon_thunk._(ptr %b, ptr %s.var), !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %i.var), !dbg !18 -// CHECK:STDOUT: call void @_ZNK1Bcv1IEv.carbon_thunk._(ptr %b, ptr %i.var), !dbg !18 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: %s.var = alloca i16, align 2, !dbg !18 +// CHECK:STDOUT: %i.var = alloca i16, align 2, !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %s.var), !dbg !18 +// CHECK:STDOUT: call void @_ZNK1Bcv1SEv.carbon_thunk._(ptr %b, ptr %s.var), !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %i.var), !dbg !19 +// CHECK:STDOUT: call void @_ZNK1Bcv1IEv.carbon_thunk._(ptr %b, ptr %i.var), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -192,12 +193,12 @@ fn ConvertToValue(b: Cpp.B) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !20, !nonnull !24 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !21, !nonnull !25 // CHECK:STDOUT: %call = call noundef signext i16 @_ZNK1Bcv1SEv(ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !25 +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !26 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -206,27 +207,27 @@ fn ConvertToValue(b: Cpp.B) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !20, !nonnull !24 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !21, !nonnull !25 // CHECK:STDOUT: %call = call noundef signext i16 @_ZNK1Bcv1IEv(ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !27 +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !28 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !29 { +// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc20_25.1.temp = alloca i16, align 2, !dbg !32 -// CHECK:STDOUT: %.loc21_25.1.temp = alloca i16, align 2, !dbg !33 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !32 -// CHECK:STDOUT: call void @_ZNK1Bcv1SEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !32 -// CHECK:STDOUT: %.loc20_25.5 = load i16, ptr %.loc20_25.1.temp, align 2, !dbg !32 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_25.1.temp), !dbg !33 -// CHECK:STDOUT: call void @_ZNK1Bcv1IEv.carbon_thunk._(ptr %b, ptr %.loc21_25.1.temp), !dbg !33 -// CHECK:STDOUT: %.loc21_25.5 = load i16, ptr %.loc21_25.1.temp, align 2, !dbg !33 -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: %.loc20_25.1.temp = alloca i16, align 2, !dbg !33 +// CHECK:STDOUT: %.loc21_25.1.temp = alloca i16, align 2, !dbg !34 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !33 +// CHECK:STDOUT: call void @_ZNK1Bcv1SEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !33 +// CHECK:STDOUT: %.loc20_25.5 = load i16, ptr %.loc20_25.1.temp, align 2, !dbg !33 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_25.1.temp), !dbg !34 +// CHECK:STDOUT: call void @_ZNK1Bcv1IEv.carbon_thunk._(ptr %b, ptr %.loc21_25.1.temp), !dbg !34 +// CHECK:STDOUT: %.loc21_25.5 = load i16, ptr %.loc21_25.1.temp, align 2, !dbg !34 +// CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -255,34 +256,35 @@ fn ConvertToValue(b: Cpp.B) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !1, line: 14, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 15, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 16, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 14, column: 1, scope: !11) -// CHECK:STDOUT: !20 = !{!21, !21, i64 0} -// CHECK:STDOUT: !21 = !{!"p1 _ZTS1B", !22, i64 0} -// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !23 = !{!22, !22, i64 0} -// CHECK:STDOUT: !24 = !{} -// CHECK:STDOUT: !25 = !{!26, !26, i64 0} -// CHECK:STDOUT: !26 = !{!"_ZTS1S", !9, i64 0} -// CHECK:STDOUT: !27 = !{!28, !28, i64 0} -// CHECK:STDOUT: !28 = !{!"_ZTS1I", !9, i64 0} -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !1, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) -// CHECK:STDOUT: !30 = !{!31} -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !14) -// CHECK:STDOUT: !32 = !DILocation(line: 20, column: 25, scope: !29) -// CHECK:STDOUT: !33 = !DILocation(line: 21, column: 25, scope: !29) -// CHECK:STDOUT: !34 = !DILocation(line: 19, column: 1, scope: !29) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !1, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 15, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 16, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 14, column: 1, scope: !12) +// CHECK:STDOUT: !21 = !{!22, !22, i64 0} +// CHECK:STDOUT: !22 = !{!"p1 _ZTS1B", !23, i64 0} +// CHECK:STDOUT: !23 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !24 = !{!23, !23, i64 0} +// CHECK:STDOUT: !25 = !{} +// CHECK:STDOUT: !26 = !{!27, !27, i64 0} +// CHECK:STDOUT: !27 = !{!"_ZTS1S", !10, i64 0} +// CHECK:STDOUT: !28 = !{!29, !29, i64 0} +// CHECK:STDOUT: !29 = !{!"_ZTS1I", !10, i64 0} +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !1, line: 19, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !15) +// CHECK:STDOUT: !33 = !DILocation(line: 20, column: 25, scope: !30) +// CHECK:STDOUT: !34 = !DILocation(line: 21, column: 25, scope: !30) +// CHECK:STDOUT: !35 = !DILocation(line: 19, column: 1, scope: !30) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'class_to_int.carbon' @@ -291,37 +293,37 @@ fn ConvertToValue(b: Cpp.B) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !17 -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK1BcviEv.carbon_thunk._(ptr %b), !dbg !17 -// CHECK:STDOUT: store i32 %__carbon_thunk.call, ptr %a.var, align 4, !dbg !17 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %a.var), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !18 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK1BcviEv.carbon_thunk._(ptr %b), !dbg !18 +// CHECK:STDOUT: store i32 %__carbon_thunk.call, ptr %a.var, align 4, !dbg !18 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %a.var), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal noundef i32 @_ZNK1BcviEv.carbon_thunk._(ptr noundef nonnull align 1 dereferenceable(1) %this) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !19 -// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !19, !nonnull !22 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !20 +// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !20, !nonnull !23 // CHECK:STDOUT: %call = call noundef i32 @_ZNK1BcviEv(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret i32 %call // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !23 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !30 { +// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !31 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK1BcviEv.carbon_thunk._(ptr %b), !dbg !33 -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK1BcviEv.carbon_thunk._(ptr %b), !dbg !34 +// CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -345,32 +347,33 @@ fn ConvertToValue(b: Cpp.B) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !1, line: 11, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 11, column: 1, scope: !11) -// CHECK:STDOUT: !19 = !{!20, !20, i64 0} -// CHECK:STDOUT: !20 = !{!"p1 _ZTS1B", !21, i64 0} -// CHECK:STDOUT: !21 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !22 = !{} -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 12, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !27) -// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) -// CHECK:STDOUT: !25 = !{null, !26} -// CHECK:STDOUT: !26 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !27 = !{!28} -// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !23, type: !26) -// CHECK:STDOUT: !29 = !DILocation(line: 12, column: 3, scope: !23) -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !1, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) -// CHECK:STDOUT: !31 = !{!32} -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !14) -// CHECK:STDOUT: !33 = !DILocation(line: 16, column: 27, scope: !30) -// CHECK:STDOUT: !34 = !DILocation(line: 15, column: 1, scope: !30) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !1, line: 11, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 1, scope: !12) +// CHECK:STDOUT: !20 = !{!21, !21, i64 0} +// CHECK:STDOUT: !21 = !{!"p1 _ZTS1B", !22, i64 0} +// CHECK:STDOUT: !22 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !23 = !{} +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 12, type: !25, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28) +// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) +// CHECK:STDOUT: !26 = !{null, !27} +// CHECK:STDOUT: !27 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !28 = !{!29} +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !24, type: !27) +// CHECK:STDOUT: !30 = !DILocation(line: 12, column: 3, scope: !24) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !1, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !32) +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !15) +// CHECK:STDOUT: !34 = !DILocation(line: 16, column: 27, scope: !31) +// CHECK:STDOUT: !35 = !DILocation(line: 15, column: 1, scope: !31) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon b/toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon index b836ca29319ca..8829a9847e5ed 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon @@ -123,17 +123,17 @@ fn PassTemporary() { // CHECK:STDOUT: define internal void @_Z4makev.carbon_thunk.(ptr noundef %return) #0 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !11 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !12 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !12 // CHECK:STDOUT: call void @_Z4makev(ptr dead_on_unwind writable sret(%struct.Copyable) align 1 %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassGlobal.Main() #1 !dbg !14 { +// CHECK:STDOUT: define void @_CPassGlobal.Main() #1 !dbg !15 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr @_Cc.Main), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr @_Cc.Main), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -141,55 +141,55 @@ fn PassTemporary() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.Copyable, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !11 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !12 // CHECK:STDOUT: call void @_ZN8CopyableC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp, ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: call void @_Z4pass8Copyable(ptr noundef %agg.tmp) +// CHECK:STDOUT: call void @_Z4pass8Copyable(ptr noundef align 1 %agg.tmp) // CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !19 { +// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc21_21.1.temp = alloca [1 x i8], align 1, !dbg !20 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_21.1.temp), !dbg !20 -// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr %.loc21_21.1.temp), !dbg !20 -// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr %.loc21_21.1.temp), !dbg !21 -// CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr %.loc21_21.1.temp), !dbg !20 -// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: %.loc21_21.1.temp = alloca [1 x i8], align 1, !dbg !21 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_21.1.temp), !dbg !21 +// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr %.loc21_21.1.temp), !dbg !21 +// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr %.loc21_21.1.temp), !dbg !22 +// CHECK:STDOUT: call void @_ZN8CopyableD1Ev(ptr %.loc21_21.1.temp), !dbg !21 +// CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: declare void @_ZN8CopyableD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !23 { +// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr %c), !dbg !29 -// CHECK:STDOUT: ret void, !dbg !30 +// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr %c), !dbg !30 +// CHECK:STDOUT: ret void, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !31 { +// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !32 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr %c), !dbg !34 -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: call void @_Z4pass8Copyable.carbon_thunk._(ptr %c), !dbg !35 +// CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !36 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr @_Cc.Main), !dbg !37 -// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr @_Cc.Main), !dbg !38 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z4makev(ptr dead_on_unwind writable sret(%struct.Copyable) align 1) #4 // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_Z4pass8Copyable(ptr noundef) #4 +// CHECK:STDOUT: declare void @_Z4pass8Copyable(ptr noundef align 1) #4 // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN8CopyableC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 // CHECK:STDOUT: @@ -210,38 +210,39 @@ fn PassTemporary() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTS8Copyable", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "PassGlobal", linkageName: "_CPassGlobal.Main", scope: null, file: !1, line: 16, type: !15, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !16 = !{null} -// CHECK:STDOUT: !17 = !DILocation(line: 17, column: 3, scope: !14) -// CHECK:STDOUT: !18 = !DILocation(line: 16, column: 1, scope: !14) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !1, line: 20, type: !15, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !20 = !DILocation(line: 21, column: 12, scope: !19) -// CHECK:STDOUT: !21 = !DILocation(line: 21, column: 3, scope: !19) -// CHECK:STDOUT: !22 = !DILocation(line: 20, column: 1, scope: !19) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !1, line: 24, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !27) -// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) -// CHECK:STDOUT: !25 = !{null, !26} -// CHECK:STDOUT: !26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !27 = !{!28} -// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !23, type: !26) -// CHECK:STDOUT: !29 = !DILocation(line: 25, column: 3, scope: !23) -// CHECK:STDOUT: !30 = !DILocation(line: 24, column: 1, scope: !23) -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !1, line: 28, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !32) -// CHECK:STDOUT: !32 = !{!33} -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !26) -// CHECK:STDOUT: !34 = !DILocation(line: 29, column: 3, scope: !31) -// CHECK:STDOUT: !35 = !DILocation(line: 28, column: 1, scope: !31) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !15, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !37 = !DILocation(line: 14, column: 23, scope: !36) -// CHECK:STDOUT: !38 = !DILocation(line: 0, scope: !36) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTS8Copyable", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "PassGlobal", linkageName: "_CPassGlobal.Main", scope: null, file: !1, line: 16, type: !16, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !16 = !DISubroutineType(types: !17) +// CHECK:STDOUT: !17 = !{null} +// CHECK:STDOUT: !18 = !DILocation(line: 17, column: 3, scope: !15) +// CHECK:STDOUT: !19 = !DILocation(line: 16, column: 1, scope: !15) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !1, line: 20, type: !16, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !21 = !DILocation(line: 21, column: 12, scope: !20) +// CHECK:STDOUT: !22 = !DILocation(line: 21, column: 3, scope: !20) +// CHECK:STDOUT: !23 = !DILocation(line: 20, column: 1, scope: !20) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !1, line: 24, type: !25, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28) +// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) +// CHECK:STDOUT: !26 = !{null, !27} +// CHECK:STDOUT: !27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !28 = !{!29} +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !24, type: !27) +// CHECK:STDOUT: !30 = !DILocation(line: 25, column: 3, scope: !24) +// CHECK:STDOUT: !31 = !DILocation(line: 24, column: 1, scope: !24) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !1, line: 28, type: !25, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) +// CHECK:STDOUT: !33 = !{!34} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !27) +// CHECK:STDOUT: !35 = !DILocation(line: 29, column: 3, scope: !32) +// CHECK:STDOUT: !36 = !DILocation(line: 28, column: 1, scope: !32) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !16, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !38 = !DILocation(line: 14, column: 23, scope: !37) +// CHECK:STDOUT: !39 = !DILocation(line: 0, scope: !37) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'copy_or_move.carbon' @@ -258,17 +259,17 @@ fn PassTemporary() { // CHECK:STDOUT: define internal void @_Z4makev.carbon_thunk.(ptr noundef %return) #0 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !11 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !12 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !12 // CHECK:STDOUT: call void @_Z4makev(ptr dead_on_unwind writable sret(%struct.CopyOrMove) align 1 %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassGlobal.Main() #1 !dbg !14 { +// CHECK:STDOUT: define void @_CPassGlobal.Main() #1 !dbg !15 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk._(ptr @_Cc.Main), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk._(ptr @_Cc.Main), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -276,23 +277,23 @@ fn PassTemporary() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.CopyOrMove, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !11 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !12 // CHECK:STDOUT: call void @_ZN10CopyOrMoveC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp, ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: call void @_Z4pass10CopyOrMove(ptr noundef %agg.tmp) +// CHECK:STDOUT: call void @_Z4pass10CopyOrMove(ptr noundef align 1 %agg.tmp) // CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !19 { +// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !20 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !20 -// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr %_.var), !dbg !21 -// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk.v(ptr %_.var), !dbg !22 -// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr %_.var), !dbg !20 -// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !21 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !21 +// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr %_.var), !dbg !22 +// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk.v(ptr %_.var), !dbg !23 +// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr %_.var), !dbg !21 +// CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -300,10 +301,10 @@ fn PassTemporary() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.CopyOrMove, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !11 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !12 // CHECK:STDOUT: call void @_ZN10CopyOrMoveC1EOS_(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp, ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: call void @_Z4pass10CopyOrMove(ptr noundef %agg.tmp) +// CHECK:STDOUT: call void @_Z4pass10CopyOrMove(ptr noundef align 1 %agg.tmp) // CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -312,32 +313,32 @@ fn PassTemporary() { // CHECK:STDOUT: declare void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !24 { +// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk._(ptr %c), !dbg !30 -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk._(ptr %c), !dbg !31 +// CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !32 { +// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk._(ptr %c), !dbg !35 -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: call void @_Z4pass10CopyOrMove.carbon_thunk._(ptr %c), !dbg !36 +// CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !37 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !38 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr @_Cc.Main), !dbg !38 -// CHECK:STDOUT: ret void, !dbg !39 +// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr @_Cc.Main), !dbg !39 +// CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z4makev(ptr dead_on_unwind writable sret(%struct.CopyOrMove) align 1) #4 // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_Z4pass10CopyOrMove(ptr noundef) #4 +// CHECK:STDOUT: declare void @_Z4pass10CopyOrMove(ptr noundef align 1) #4 // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN10CopyOrMoveC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 // CHECK:STDOUT: @@ -364,39 +365,40 @@ fn PassTemporary() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTS10CopyOrMove", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "PassGlobal", linkageName: "_CPassGlobal.Main", scope: null, file: !1, line: 18, type: !15, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !16 = !{null} -// CHECK:STDOUT: !17 = !DILocation(line: 19, column: 3, scope: !14) -// CHECK:STDOUT: !18 = !DILocation(line: 18, column: 1, scope: !14) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !1, line: 22, type: !15, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !20 = !DILocation(line: 13, column: 21, scope: !19) -// CHECK:STDOUT: !21 = !DILocation(line: 23, column: 12, scope: !19) -// CHECK:STDOUT: !22 = !DILocation(line: 23, column: 3, scope: !19) -// CHECK:STDOUT: !23 = !DILocation(line: 22, column: 1, scope: !19) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !1, line: 26, type: !25, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28) -// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !26 = !{null, !27} -// CHECK:STDOUT: !27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !28 = !{!29} -// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !24, type: !27) -// CHECK:STDOUT: !30 = !DILocation(line: 27, column: 3, scope: !24) -// CHECK:STDOUT: !31 = !DILocation(line: 26, column: 1, scope: !24) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !1, line: 30, type: !25, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) -// CHECK:STDOUT: !33 = !{!34} -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !27) -// CHECK:STDOUT: !35 = !DILocation(line: 31, column: 3, scope: !32) -// CHECK:STDOUT: !36 = !DILocation(line: 30, column: 1, scope: !32) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !15, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !38 = !DILocation(line: 16, column: 25, scope: !37) -// CHECK:STDOUT: !39 = !DILocation(line: 0, scope: !37) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTS10CopyOrMove", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "PassGlobal", linkageName: "_CPassGlobal.Main", scope: null, file: !1, line: 18, type: !16, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !16 = !DISubroutineType(types: !17) +// CHECK:STDOUT: !17 = !{null} +// CHECK:STDOUT: !18 = !DILocation(line: 19, column: 3, scope: !15) +// CHECK:STDOUT: !19 = !DILocation(line: 18, column: 1, scope: !15) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !1, line: 22, type: !16, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !21 = !DILocation(line: 13, column: 21, scope: !20) +// CHECK:STDOUT: !22 = !DILocation(line: 23, column: 12, scope: !20) +// CHECK:STDOUT: !23 = !DILocation(line: 23, column: 3, scope: !20) +// CHECK:STDOUT: !24 = !DILocation(line: 22, column: 1, scope: !20) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !1, line: 26, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !29) +// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) +// CHECK:STDOUT: !27 = !{null, !28} +// CHECK:STDOUT: !28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !29 = !{!30} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !25, type: !28) +// CHECK:STDOUT: !31 = !DILocation(line: 27, column: 3, scope: !25) +// CHECK:STDOUT: !32 = !DILocation(line: 26, column: 1, scope: !25) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !1, line: 30, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !28) +// CHECK:STDOUT: !36 = !DILocation(line: 31, column: 3, scope: !33) +// CHECK:STDOUT: !37 = !DILocation(line: 30, column: 1, scope: !33) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !16, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !39 = !DILocation(line: 16, column: 25, scope: !38) +// CHECK:STDOUT: !40 = !DILocation(line: 0, scope: !38) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'move_only.carbon' @@ -413,27 +415,27 @@ fn PassTemporary() { // CHECK:STDOUT: define internal void @_Z4makev.carbon_thunk.(ptr noundef %return) #0 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !11 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !12 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !12 // CHECK:STDOUT: call void @_Z4makev(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1 %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassGlobalByMove.Main() #1 !dbg !14 { +// CHECK:STDOUT: define void @_CPassGlobalByMove.Main() #1 !dbg !15 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !17 +// CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !18 { +// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !19 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !19 -// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr %_.var), !dbg !20 -// CHECK:STDOUT: call void @_Z4pass8MoveOnly.carbon_thunk.v(ptr %_.var), !dbg !21 -// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr %_.var), !dbg !19 -// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !20 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !20 +// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr %_.var), !dbg !21 +// CHECK:STDOUT: call void @_Z4pass8MoveOnly.carbon_thunk.v(ptr %_.var), !dbg !22 +// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr %_.var), !dbg !20 +// CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -441,10 +443,10 @@ fn PassTemporary() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.MoveOnly, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !11 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !12 // CHECK:STDOUT: call void @_ZN8MoveOnlyC1EOS_(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp, ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: call void @_Z4pass8MoveOnly(ptr noundef %agg.tmp) +// CHECK:STDOUT: call void @_Z4pass8MoveOnly(ptr noundef align 1 %agg.tmp) // CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -456,15 +458,15 @@ fn PassTemporary() { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !23 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr @_Cc.Main), !dbg !24 -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: call void @_Z4makev.carbon_thunk.(ptr @_Cc.Main), !dbg !25 +// CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z4makev(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1) #4 // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_Z4pass8MoveOnly(ptr noundef) #4 +// CHECK:STDOUT: declare void @_Z4pass8MoveOnly(ptr noundef align 1) #4 // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN8MoveOnlyC1EOS_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 // CHECK:STDOUT: @@ -488,23 +490,24 @@ fn PassTemporary() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTS8MoveOnly", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "PassGlobalByMove", linkageName: "_CPassGlobalByMove.Main", scope: null, file: !1, line: 22, type: !15, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !16 = !{null} -// CHECK:STDOUT: !17 = !DILocation(line: 22, column: 1, scope: !14) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !1, line: 27, type: !15, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !19 = !DILocation(line: 17, column: 19, scope: !18) -// CHECK:STDOUT: !20 = !DILocation(line: 28, column: 12, scope: !18) -// CHECK:STDOUT: !21 = !DILocation(line: 28, column: 3, scope: !18) -// CHECK:STDOUT: !22 = !DILocation(line: 27, column: 1, scope: !18) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !15, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !24 = !DILocation(line: 20, column: 23, scope: !23) -// CHECK:STDOUT: !25 = !DILocation(line: 0, scope: !23) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTS8MoveOnly", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "PassGlobalByMove", linkageName: "_CPassGlobalByMove.Main", scope: null, file: !1, line: 22, type: !16, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !16 = !DISubroutineType(types: !17) +// CHECK:STDOUT: !17 = !{null} +// CHECK:STDOUT: !18 = !DILocation(line: 22, column: 1, scope: !15) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !1, line: 27, type: !16, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !20 = !DILocation(line: 17, column: 19, scope: !19) +// CHECK:STDOUT: !21 = !DILocation(line: 28, column: 12, scope: !19) +// CHECK:STDOUT: !22 = !DILocation(line: 28, column: 3, scope: !19) +// CHECK:STDOUT: !23 = !DILocation(line: 27, column: 1, scope: !19) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !16, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !25 = !DILocation(line: 20, column: 23, scope: !24) +// CHECK:STDOUT: !26 = !DILocation(line: 0, scope: !24) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon b/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon index c8cac59e0c112..9e6bf1c7ee79e 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon @@ -74,7 +74,7 @@ fn DoThing() { // CHECK:STDOUT: define dso_local void @_Z3UseR4Base(ptr noundef nonnull align 8 dereferenceable(12) %b) #0 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %b, ptr %b.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %b, ptr %b.addr, align 8, !tbaa !12 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -83,84 +83,84 @@ fn DoThing() { // CHECK:STDOUT: declare void @_ZNR4Base4funcEv(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_Cother_func.Derived.Main(ptr %self) #2 !dbg !14 { +// CHECK:STDOUT: define void @_Cother_func.Derived.Main(ptr %self) #2 !dbg !15 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !20 +// CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_Cfunc.Derived.Main(ptr %self) #2 !dbg !21 { +// CHECK:STDOUT: define void @_Cfunc.Derived.Main(ptr %self) #2 !dbg !22 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_Cfunc:thunk:Base.Cpp:Derived.Main"(ptr %self) #3 !dbg !25 { +// CHECK:STDOUT: define void @"_Cfunc:thunk:Base.Cpp:Derived.Main"(ptr %self) #3 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Cfunc.Derived.Main(ptr %self), !dbg !28 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: call void @_Cfunc.Derived.Main(ptr %self), !dbg !29 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CDoThing.Main() #2 !dbg !29 { +// CHECK:STDOUT: define void @_CDoThing.Main() #2 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %d.var = alloca { [16 x i8] }, align 8, !dbg !32 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %d.var), !dbg !32 -// CHECK:STDOUT: %.loc31_44.1.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !33 -// CHECK:STDOUT: call void @_ZN4BaseC1Ev.carbon_thunk.(ptr %.loc31_44.1.base), !dbg !34 -// CHECK:STDOUT: %.loc31_44.7.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !33 -// CHECK:STDOUT: %.loc31_44.8.base = getelementptr inbounds nuw [16 x i8], ptr %.loc31_44.7.base, i32 0, i32 0, !dbg !33 -// CHECK:STDOUT: %.loc31_44.9.vptr = getelementptr inbounds nuw [8 x i8], ptr %.loc31_44.8.base, i32 0, i32 0, !dbg !33 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTVN6Carbon7DerivedE, i32 0, i32 0, i32 2), ptr %.loc31_44.9.vptr, align 8, !dbg !33 -// CHECK:STDOUT: %.loc32_11.3.base = getelementptr inbounds nuw [16 x i8], ptr %d.var, i32 0, i32 0, !dbg !35 -// CHECK:STDOUT: call void @_Z3UseR4Base(ptr %.loc32_11.3.base), !dbg !36 -// CHECK:STDOUT: call void @"_COp.8185e3504351afa8:core.Destroy.Core"(ptr %d.var), !dbg !32 -// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: %d.var = alloca { [16 x i8] }, align 8, !dbg !33 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %d.var), !dbg !33 +// CHECK:STDOUT: %.loc31_44.1.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !34 +// CHECK:STDOUT: call void @_ZN4BaseC1Ev.carbon_thunk.(ptr %.loc31_44.1.base), !dbg !35 +// CHECK:STDOUT: %.loc31_44.7.base = getelementptr inbounds nuw { [16 x i8] }, ptr %d.var, i32 0, i32 0, !dbg !34 +// CHECK:STDOUT: %.loc31_44.8.base = getelementptr inbounds nuw [16 x i8], ptr %.loc31_44.7.base, i32 0, i32 0, !dbg !34 +// CHECK:STDOUT: %.loc31_44.9.vptr = getelementptr inbounds nuw [8 x i8], ptr %.loc31_44.8.base, i32 0, i32 0, !dbg !34 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTVN6Carbon7DerivedE, i32 0, i32 0, i32 2), ptr %.loc31_44.9.vptr, align 8, !dbg !34 +// CHECK:STDOUT: %.loc32_11.3.base = getelementptr inbounds nuw [16 x i8], ptr %d.var, i32 0, i32 0, !dbg !36 +// CHECK:STDOUT: call void @_Z3UseR4Base(ptr %.loc32_11.3.base), !dbg !37 +// CHECK:STDOUT: call void @"_COp.8185e3504351afa8:core.Destroy.Core"(ptr %d.var), !dbg !33 +// CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN4BaseC1Ev.carbon_thunk.(ptr noundef %return) #4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !11 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !12 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !12 // CHECK:STDOUT: call void @_ZN4BaseC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %0) #2 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.Derived.Main"(ptr %self) #3 !dbg !38 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.Derived.Main"(ptr %self) #3 !dbg !39 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.8185e3504351afa8:core.Destroy.Core"(ptr %self), !dbg !41 -// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: call void @"_COp.8185e3504351afa8:core.Destroy.Core"(ptr %self), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.13b019890e86b6be:core.Destroy.Core"(ptr %self) #2 !dbg !42 { +// CHECK:STDOUT: define weak_odr void @"_COp.13b019890e86b6be:core.Destroy.Core"(ptr %self) #2 !dbg !43 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !45 +// CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8185e3504351afa8:core.Destroy.Core"(ptr %self) #2 !dbg !46 { +// CHECK:STDOUT: define weak_odr void @"_COp.8185e3504351afa8:core.Destroy.Core"(ptr %self) #2 !dbg !47 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !49 +// CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_Cfunc__carbon_thunk.Derived.Main(ptr %self) #2 !dbg !50 { +// CHECK:STDOUT: define void @_Cfunc__carbon_thunk.Derived.Main(ptr %self) #2 !dbg !51 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Cfunc.Derived.Main(ptr %self), !dbg !53 -// CHECK:STDOUT: ret void, !dbg !53 +// CHECK:STDOUT: call void @_Cfunc.Derived.Main(ptr %self), !dbg !54 +// CHECK:STDOUT: ret void, !dbg !54 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_Cother_func__carbon_thunk.Derived.Main(ptr %self) #2 !dbg !54 { +// CHECK:STDOUT: define void @_Cother_func__carbon_thunk.Derived.Main(ptr %self) #2 !dbg !55 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Derived.other_func.call.vtable = load ptr, ptr %self, align 8, !dbg !57 -// CHECK:STDOUT: %Derived.other_func.call = call ptr @llvm.load.relative.i32(ptr %Derived.other_func.call.vtable, i32 8), !dbg !57 -// CHECK:STDOUT: call void %Derived.other_func.call(ptr %self), !dbg !57 -// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: %Derived.other_func.call.vtable = load ptr, ptr %self, align 8, !dbg !58 +// CHECK:STDOUT: %Derived.other_func.call = call ptr @llvm.load.relative.i32(ptr %Derived.other_func.call.vtable, i32 8), !dbg !58 +// CHECK:STDOUT: call void %Derived.other_func.call(ptr %self), !dbg !58 +// CHECK:STDOUT: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -173,7 +173,7 @@ fn DoThing() { // CHECK:STDOUT: define internal void @_ZNR6Carbon7Derived4funcEv(ptr noundef nonnull align 8 dereferenceable(12) %this) unnamed_addr #4 align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !58 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !59 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_Cfunc__carbon_thunk.Derived.Main(ptr noundef nonnull align 8 dereferenceable(12) %this1) // CHECK:STDOUT: ret void @@ -183,7 +183,7 @@ fn DoThing() { // CHECK:STDOUT: define internal void @_ZN6Carbon7Derived10other_funcEv(ptr noundef nonnull align 8 dereferenceable(12) %this) unnamed_addr #4 align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !58 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !59 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_Cother_func__carbon_thunk.Derived.Main(ptr noundef nonnull align 8 dereferenceable(12) %this1) // CHECK:STDOUT: ret void @@ -193,10 +193,10 @@ fn DoThing() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN4BaseC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %this) unnamed_addr #7 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_ZN11FurtherBaseC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this1) #2 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTV4Base, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !60 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTV4Base, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !61 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -204,9 +204,9 @@ fn DoThing() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11FurtherBaseC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #7 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !62 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !63 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTV11FurtherBase, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !60 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 8) ({ [3 x ptr] }, ptr @_ZTV11FurtherBase, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !61 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -234,61 +234,62 @@ fn DoThing() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTS4Base", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "other_func", linkageName: "_Cother_func.Derived.Main", scope: null, file: !1, line: 24, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !18) -// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !16 = !{null, !17} -// CHECK:STDOUT: !17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !18 = !{!19} -// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !14, type: !17) -// CHECK:STDOUT: !20 = !DILocation(line: 24, column: 3, scope: !14) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "func", linkageName: "_Cfunc.Derived.Main", scope: null, file: !1, line: 26, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) -// CHECK:STDOUT: !22 = !{!23} -// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !21, type: !17) -// CHECK:STDOUT: !24 = !DILocation(line: 26, column: 3, scope: !21) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "func", linkageName: "_Cfunc:thunk:Base.Cpp:Derived.Main", scope: null, file: !1, line: 26, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) -// CHECK:STDOUT: !26 = !{!27} -// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !17) -// CHECK:STDOUT: !28 = !DILocation(line: 26, column: 3, scope: !25) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "DoThing", linkageName: "_CDoThing.Main", scope: null, file: !1, line: 30, type: !30, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) -// CHECK:STDOUT: !31 = !{null} -// CHECK:STDOUT: !32 = !DILocation(line: 31, column: 3, scope: !29) -// CHECK:STDOUT: !33 = !DILocation(line: 31, column: 20, scope: !29) -// CHECK:STDOUT: !34 = !DILocation(line: 31, column: 29, scope: !29) -// CHECK:STDOUT: !35 = !DILocation(line: 32, column: 11, scope: !29) -// CHECK:STDOUT: !36 = !DILocation(line: 32, column: 3, scope: !29) -// CHECK:STDOUT: !37 = !DILocation(line: 30, column: 1, scope: !29) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.Derived.Main", scope: null, file: !1, line: 22, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !39) -// CHECK:STDOUT: !39 = !{!40} -// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !17) -// CHECK:STDOUT: !41 = !DILocation(line: 22, column: 1, scope: !38) -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.13b019890e86b6be:core.Destroy.Core", scope: null, file: !1, line: 22, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43) -// CHECK:STDOUT: !43 = !{!44} -// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !42, type: !17) -// CHECK:STDOUT: !45 = !DILocation(line: 22, column: 1, scope: !42) -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8185e3504351afa8:core.Destroy.Core", scope: null, file: !1, line: 22, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !47) -// CHECK:STDOUT: !47 = !{!48} -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !17) -// CHECK:STDOUT: !49 = !DILocation(line: 22, column: 1, scope: !46) -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "func__carbon_thunk", linkageName: "_Cfunc__carbon_thunk.Derived.Main", scope: null, file: !1, line: 26, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !51) -// CHECK:STDOUT: !51 = !{!52} -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !50, type: !17) -// CHECK:STDOUT: !53 = !DILocation(line: 26, column: 3, scope: !50) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "other_func__carbon_thunk", linkageName: "_Cother_func__carbon_thunk.Derived.Main", scope: null, file: !1, line: 24, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !55) -// CHECK:STDOUT: !55 = !{!56} -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !54, type: !17) -// CHECK:STDOUT: !57 = !DILocation(line: 24, column: 3, scope: !54) -// CHECK:STDOUT: !58 = !{!59, !59, i64 0} -// CHECK:STDOUT: !59 = !{!"p1 _ZTSN6Carbon7DerivedE", !13, i64 0} -// CHECK:STDOUT: !60 = !{!61, !61, i64 0} -// CHECK:STDOUT: !61 = !{!"vtable pointer", !10, i64 0} -// CHECK:STDOUT: !62 = !{!63, !63, i64 0} -// CHECK:STDOUT: !63 = !{!"p1 _ZTS11FurtherBase", !13, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTS4Base", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "other_func", linkageName: "_Cother_func.Derived.Main", scope: null, file: !1, line: 24, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !19) +// CHECK:STDOUT: !16 = !DISubroutineType(types: !17) +// CHECK:STDOUT: !17 = !{null, !18} +// CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !19 = !{!20} +// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !15, type: !18) +// CHECK:STDOUT: !21 = !DILocation(line: 24, column: 3, scope: !15) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "func", linkageName: "_Cfunc.Derived.Main", scope: null, file: !1, line: 26, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !22, type: !18) +// CHECK:STDOUT: !25 = !DILocation(line: 26, column: 3, scope: !22) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "func", linkageName: "_Cfunc:thunk:Base.Cpp:Derived.Main", scope: null, file: !1, line: 26, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !26, type: !18) +// CHECK:STDOUT: !29 = !DILocation(line: 26, column: 3, scope: !26) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "DoThing", linkageName: "_CDoThing.Main", scope: null, file: !1, line: 30, type: !31, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) +// CHECK:STDOUT: !32 = !{null} +// CHECK:STDOUT: !33 = !DILocation(line: 31, column: 3, scope: !30) +// CHECK:STDOUT: !34 = !DILocation(line: 31, column: 20, scope: !30) +// CHECK:STDOUT: !35 = !DILocation(line: 31, column: 29, scope: !30) +// CHECK:STDOUT: !36 = !DILocation(line: 32, column: 11, scope: !30) +// CHECK:STDOUT: !37 = !DILocation(line: 32, column: 3, scope: !30) +// CHECK:STDOUT: !38 = !DILocation(line: 30, column: 1, scope: !30) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.Derived.Main", scope: null, file: !1, line: 22, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !40) +// CHECK:STDOUT: !40 = !{!41} +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !39, type: !18) +// CHECK:STDOUT: !42 = !DILocation(line: 22, column: 1, scope: !39) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.13b019890e86b6be:core.Destroy.Core", scope: null, file: !1, line: 22, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !44) +// CHECK:STDOUT: !44 = !{!45} +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !43, type: !18) +// CHECK:STDOUT: !46 = !DILocation(line: 22, column: 1, scope: !43) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8185e3504351afa8:core.Destroy.Core", scope: null, file: !1, line: 22, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !48) +// CHECK:STDOUT: !48 = !{!49} +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !47, type: !18) +// CHECK:STDOUT: !50 = !DILocation(line: 22, column: 1, scope: !47) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "func__carbon_thunk", linkageName: "_Cfunc__carbon_thunk.Derived.Main", scope: null, file: !1, line: 26, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !52) +// CHECK:STDOUT: !52 = !{!53} +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !51, type: !18) +// CHECK:STDOUT: !54 = !DILocation(line: 26, column: 3, scope: !51) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "other_func__carbon_thunk", linkageName: "_Cother_func__carbon_thunk.Derived.Main", scope: null, file: !1, line: 24, type: !16, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !56) +// CHECK:STDOUT: !56 = !{!57} +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !18) +// CHECK:STDOUT: !58 = !DILocation(line: 24, column: 3, scope: !55) +// CHECK:STDOUT: !59 = !{!60, !60, i64 0} +// CHECK:STDOUT: !60 = !{!"p1 _ZTSN6Carbon7DerivedE", !14, i64 0} +// CHECK:STDOUT: !61 = !{!62, !62, i64 0} +// CHECK:STDOUT: !62 = !{!"vtable pointer", !11, i64 0} +// CHECK:STDOUT: !63 = !{!64, !64, i64 0} +// CHECK:STDOUT: !64 = !{!"p1 _ZTS11FurtherBase", !14, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/field.carbon b/toolchain/lower/testdata/interop/cpp/class/import/field.carbon index 8263bb0c663de..b18c97cdd43bf 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/field.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/field.carbon @@ -115,19 +115,19 @@ fn AccessP(a: Cpp.A) -> i32 { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessN.Main(ptr %a) #0 !dbg !11 { +// CHECK:STDOUT: define i32 @_CAccessN.Main(ptr %a) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_11.1.n = getelementptr inbounds nuw [32 x i8], ptr %a, i32 0, i32 0, !dbg !18 -// CHECK:STDOUT: %.loc9_11.2 = load i32, ptr %.loc9_11.1.n, align 4, !dbg !18 -// CHECK:STDOUT: ret i32 %.loc9_11.2, !dbg !19 +// CHECK:STDOUT: %.loc9_11.1.n = getelementptr inbounds nuw [32 x i8], ptr %a, i32 0, i32 0, !dbg !19 +// CHECK:STDOUT: %.loc9_11.2 = load i32, ptr %.loc9_11.1.n, align 4, !dbg !19 +// CHECK:STDOUT: ret i32 %.loc9_11.2, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessM.Main(ptr %a) #0 !dbg !20 { +// CHECK:STDOUT: define i32 @_CAccessM.Main(ptr %a) #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc13_11.1.m = getelementptr inbounds nuw [32 x i8], ptr %a, i32 0, i32 16, !dbg !23 -// CHECK:STDOUT: %.loc13_11.2 = load i32, ptr %.loc13_11.1.m, align 4, !dbg !23 -// CHECK:STDOUT: ret i32 %.loc13_11.2, !dbg !24 +// CHECK:STDOUT: %.loc13_11.1.m = getelementptr inbounds nuw [32 x i8], ptr %a, i32 0, i32 16, !dbg !24 +// CHECK:STDOUT: %.loc13_11.2 = load i32, ptr %.loc13_11.1.m, align 4, !dbg !24 +// CHECK:STDOUT: ret i32 %.loc13_11.2, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -143,24 +143,25 @@ fn AccessP(a: Cpp.A) -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !1, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !15} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !16 = !{!17} -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !11, type: !15) -// CHECK:STDOUT: !18 = !DILocation(line: 9, column: 10, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "AccessM", linkageName: "_CAccessM.Main", scope: null, file: !1, line: 12, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) -// CHECK:STDOUT: !21 = !{!22} -// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !15) -// CHECK:STDOUT: !23 = !DILocation(line: 13, column: 10, scope: !20) -// CHECK:STDOUT: !24 = !DILocation(line: 13, column: 3, scope: !20) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !1, line: 8, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !17) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !16} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !17 = !{!18} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !12, type: !16) +// CHECK:STDOUT: !19 = !DILocation(line: 9, column: 10, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "AccessM", linkageName: "_CAccessM.Main", scope: null, file: !1, line: 12, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !21, type: !16) +// CHECK:STDOUT: !24 = !DILocation(line: 13, column: 10, scope: !21) +// CHECK:STDOUT: !25 = !DILocation(line: 13, column: 3, scope: !21) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'assign_struct.carbon' @@ -169,19 +170,19 @@ fn AccessP(a: Cpp.A) -> i32 { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CAssignN.Main(ptr %p) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CAssignN.Main(ptr %p) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_4.2.n = getelementptr inbounds nuw [32 x i8], ptr %p, i32 0, i32 0, !dbg !17 -// CHECK:STDOUT: store i32 1, ptr %.loc9_4.2.n, align 4, !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: %.loc9_4.2.n = getelementptr inbounds nuw [32 x i8], ptr %p, i32 0, i32 0, !dbg !18 +// CHECK:STDOUT: store i32 1, ptr %.loc9_4.2.n, align 4, !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CAssignM.Main(ptr %p) #0 !dbg !19 { +// CHECK:STDOUT: define void @_CAssignM.Main(ptr %p) #0 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc13_4.2.m = getelementptr inbounds nuw [32 x i8], ptr %p, i32 0, i32 16, !dbg !22 -// CHECK:STDOUT: store i32 1, ptr %.loc13_4.2.m, align 4, !dbg !22 -// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: %.loc13_4.2.m = getelementptr inbounds nuw [32 x i8], ptr %p, i32 0, i32 16, !dbg !23 +// CHECK:STDOUT: store i32 1, ptr %.loc13_4.2.m, align 4, !dbg !23 +// CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -197,23 +198,24 @@ fn AccessP(a: Cpp.A) -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "AssignN", linkageName: "_CAssignN.Main", scope: null, file: !1, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 8, column: 1, scope: !11) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "AssignM", linkageName: "_CAssignM.Main", scope: null, file: !1, line: 12, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !20) -// CHECK:STDOUT: !20 = !{!21} -// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !19, type: !14) -// CHECK:STDOUT: !22 = !DILocation(line: 13, column: 3, scope: !19) -// CHECK:STDOUT: !23 = !DILocation(line: 12, column: 1, scope: !19) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "AssignN", linkageName: "_CAssignN.Main", scope: null, file: !1, line: 8, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 8, column: 1, scope: !12) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "AssignM", linkageName: "_CAssignM.Main", scope: null, file: !1, line: 12, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) +// CHECK:STDOUT: !21 = !{!22} +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !15) +// CHECK:STDOUT: !23 = !DILocation(line: 13, column: 3, scope: !20) +// CHECK:STDOUT: !24 = !DILocation(line: 12, column: 1, scope: !20) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'access_union.carbon' @@ -222,19 +224,19 @@ fn AccessP(a: Cpp.A) -> i32 { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessN.Main(ptr %a) #0 !dbg !11 { +// CHECK:STDOUT: define i32 @_CAccessN.Main(ptr %a) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_11.1.n = getelementptr inbounds nuw [4 x i8], ptr %a, i32 0, i32 0, !dbg !18 -// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.n, align 4, !dbg !18 -// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !19 +// CHECK:STDOUT: %.loc7_11.1.n = getelementptr inbounds nuw [4 x i8], ptr %a, i32 0, i32 0, !dbg !19 +// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.n, align 4, !dbg !19 +// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessM.Main(ptr %a) #0 !dbg !20 { +// CHECK:STDOUT: define i32 @_CAccessM.Main(ptr %a) #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_11.1.m = getelementptr inbounds nuw [4 x i8], ptr %a, i32 0, i32 0, !dbg !23 -// CHECK:STDOUT: %.loc11_11.2 = load i32, ptr %.loc11_11.1.m, align 4, !dbg !23 -// CHECK:STDOUT: ret i32 %.loc11_11.2, !dbg !24 +// CHECK:STDOUT: %.loc11_11.1.m = getelementptr inbounds nuw [4 x i8], ptr %a, i32 0, i32 0, !dbg !24 +// CHECK:STDOUT: %.loc11_11.2 = load i32, ptr %.loc11_11.1.m, align 4, !dbg !24 +// CHECK:STDOUT: ret i32 %.loc11_11.2, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -250,24 +252,25 @@ fn AccessP(a: Cpp.A) -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !15} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !16 = !{!17} -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !11, type: !15) -// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "AccessM", linkageName: "_CAccessM.Main", scope: null, file: !1, line: 10, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) -// CHECK:STDOUT: !21 = !{!22} -// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !15) -// CHECK:STDOUT: !23 = !DILocation(line: 11, column: 10, scope: !20) -// CHECK:STDOUT: !24 = !DILocation(line: 11, column: 3, scope: !20) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !17) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !16} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !17 = !{!18} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !12, type: !16) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "AccessM", linkageName: "_CAccessM.Main", scope: null, file: !1, line: 10, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !21, type: !16) +// CHECK:STDOUT: !24 = !DILocation(line: 11, column: 10, scope: !21) +// CHECK:STDOUT: !25 = !DILocation(line: 11, column: 3, scope: !21) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'assign_union.carbon' @@ -276,19 +279,19 @@ fn AccessP(a: Cpp.A) -> i32 { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CAssignN.Main(ptr %p) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CAssignN.Main(ptr %p) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_4.2.n = getelementptr inbounds nuw [4 x i8], ptr %p, i32 0, i32 0, !dbg !17 -// CHECK:STDOUT: store i32 1, ptr %.loc7_4.2.n, align 4, !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: %.loc7_4.2.n = getelementptr inbounds nuw [4 x i8], ptr %p, i32 0, i32 0, !dbg !18 +// CHECK:STDOUT: store i32 1, ptr %.loc7_4.2.n, align 4, !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CAssignM.Main(ptr %p) #0 !dbg !19 { +// CHECK:STDOUT: define void @_CAssignM.Main(ptr %p) #0 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_4.2.m = getelementptr inbounds nuw [4 x i8], ptr %p, i32 0, i32 0, !dbg !22 -// CHECK:STDOUT: store i32 1, ptr %.loc11_4.2.m, align 4, !dbg !22 -// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: %.loc11_4.2.m = getelementptr inbounds nuw [4 x i8], ptr %p, i32 0, i32 0, !dbg !23 +// CHECK:STDOUT: store i32 1, ptr %.loc11_4.2.m, align 4, !dbg !23 +// CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -304,23 +307,24 @@ fn AccessP(a: Cpp.A) -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "AssignN", linkageName: "_CAssignN.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "AssignM", linkageName: "_CAssignM.Main", scope: null, file: !1, line: 10, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !20) -// CHECK:STDOUT: !20 = !{!21} -// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !19, type: !14) -// CHECK:STDOUT: !22 = !DILocation(line: 11, column: 3, scope: !19) -// CHECK:STDOUT: !23 = !DILocation(line: 10, column: 1, scope: !19) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "AssignN", linkageName: "_CAssignN.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "AssignM", linkageName: "_CAssignM.Main", scope: null, file: !1, line: 10, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) +// CHECK:STDOUT: !21 = !{!22} +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !15) +// CHECK:STDOUT: !23 = !DILocation(line: 11, column: 3, scope: !20) +// CHECK:STDOUT: !24 = !DILocation(line: 10, column: 1, scope: !20) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'access_anon_union.carbon' @@ -329,20 +333,20 @@ fn AccessP(a: Cpp.A) -> i32 { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessN.Main(ptr %a) #0 !dbg !11 { +// CHECK:STDOUT: define i32 @_CAccessN.Main(ptr %a) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_11.1.n = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 8, !dbg !18 -// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.n, align 4, !dbg !18 -// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !19 +// CHECK:STDOUT: %.loc7_11.1.n = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 8, !dbg !19 +// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.n, align 4, !dbg !19 +// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessP.Main(ptr %a) #0 !dbg !20 { +// CHECK:STDOUT: define i32 @_CAccessP.Main(ptr %a) #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_12.1.p = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 8, !dbg !23 -// CHECK:STDOUT: %.loc11_12.2 = load ptr, ptr %.loc11_12.1.p, align 8, !dbg !23 -// CHECK:STDOUT: %.loc11_10.2 = load i32, ptr %.loc11_12.2, align 4, !dbg !24 -// CHECK:STDOUT: ret i32 %.loc11_10.2, !dbg !25 +// CHECK:STDOUT: %.loc11_12.1.p = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 8, !dbg !24 +// CHECK:STDOUT: %.loc11_12.2 = load ptr, ptr %.loc11_12.1.p, align 8, !dbg !24 +// CHECK:STDOUT: %.loc11_10.2 = load i32, ptr %.loc11_12.2, align 4, !dbg !25 +// CHECK:STDOUT: ret i32 %.loc11_10.2, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -358,23 +362,24 @@ fn AccessP(a: Cpp.A) -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !15} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !16 = !{!17} -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !11, type: !15) -// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "AccessP", linkageName: "_CAccessP.Main", scope: null, file: !1, line: 10, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) -// CHECK:STDOUT: !21 = !{!22} -// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !15) -// CHECK:STDOUT: !23 = !DILocation(line: 11, column: 11, scope: !20) -// CHECK:STDOUT: !24 = !DILocation(line: 11, column: 10, scope: !20) -// CHECK:STDOUT: !25 = !DILocation(line: 11, column: 3, scope: !20) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !17) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !16} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !17 = !{!18} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !12, type: !16) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "AccessP", linkageName: "_CAccessP.Main", scope: null, file: !1, line: 10, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !21, type: !16) +// CHECK:STDOUT: !24 = !DILocation(line: 11, column: 11, scope: !21) +// CHECK:STDOUT: !25 = !DILocation(line: 11, column: 10, scope: !21) +// CHECK:STDOUT: !26 = !DILocation(line: 11, column: 3, scope: !21) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/method.carbon b/toolchain/lower/testdata/interop/cpp/class/import/method.carbon index 7d6561557de01..896552ab1e82f 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/method.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/method.carbon @@ -105,10 +105,10 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: @_ZTI4Base = external constant ptr // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CUseVal.Main(ptr %a) #0 !dbg !11 { +// CHECK:STDOUT: define i32 @_CUseVal.Main(ptr %a) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %by_val__carbon_thunk.call = call i32 @_ZNK1A6by_valEv.carbon_thunk._(ptr %a), !dbg !18 -// CHECK:STDOUT: ret i32 %by_val__carbon_thunk.call, !dbg !19 +// CHECK:STDOUT: %by_val__carbon_thunk.call = call i32 @_ZNK1A6by_valEv.carbon_thunk._(ptr %a), !dbg !19 +// CHECK:STDOUT: ret i32 %by_val__carbon_thunk.call, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN4Base5virt0Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 @@ -119,8 +119,8 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: define internal noundef i32 @_ZNK1A6by_valEv.carbon_thunk._(ptr noundef nonnull align 8 dereferenceable(12) %this) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !20 -// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !20, !nonnull !23, !align !24 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !21 +// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !21, !nonnull !24, !align !25 // CHECK:STDOUT: %call = call noundef i32 @_ZNK1A6by_valEv(ptr noundef nonnull align 8 dereferenceable(12) %0) // CHECK:STDOUT: ret i32 %call // CHECK:STDOUT: } @@ -129,10 +129,10 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: define linkonce_odr dso_local noundef i32 @_ZNK1A6by_valEv(ptr noundef nonnull align 8 dereferenceable(12) %this) #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !21 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %n = getelementptr inbounds nuw %struct.A, ptr %this1, i32 0, i32 1 -// CHECK:STDOUT: %0 = load i32, ptr %n, align 8, !tbaa !25 +// CHECK:STDOUT: %0 = load i32, ptr %n, align 8, !tbaa !26 // CHECK:STDOUT: ret i32 %0 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -155,27 +155,28 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !15} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !16 = !{!17} -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !11, type: !15) -// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !20 = !{!21, !21, i64 0} -// CHECK:STDOUT: !21 = !{!"p1 _ZTS1A", !22, i64 0} -// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !23 = !{} -// CHECK:STDOUT: !24 = !{i64 8} -// CHECK:STDOUT: !25 = !{!26, !8, i64 8} -// CHECK:STDOUT: !26 = !{!"_ZTS1A", !27, i64 0, !8, i64 8} -// CHECK:STDOUT: !27 = !{!"_ZTS4Base"} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !17) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !16} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !17 = !{!18} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !12, type: !16) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !21 = !{!22, !22, i64 0} +// CHECK:STDOUT: !22 = !{!"p1 _ZTS1A", !23, i64 0} +// CHECK:STDOUT: !23 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !24 = !{} +// CHECK:STDOUT: !25 = !{i64 8} +// CHECK:STDOUT: !26 = !{!27, !9, i64 8} +// CHECK:STDOUT: !27 = !{!"_ZTS1A", !28, i64 0, !9, i64 8} +// CHECK:STDOUT: !28 = !{!"_ZTS4Base"} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_by_ref.carbon' @@ -194,10 +195,10 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: @_ZTI4Base = external constant ptr // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CUseVal.Main(ptr %a) #0 !dbg !11 { +// CHECK:STDOUT: define i32 @_CUseVal.Main(ptr %a) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %A.by_ref.call = call i32 @_ZN1A6by_refEv(ptr %a), !dbg !18 -// CHECK:STDOUT: ret i32 %A.by_ref.call, !dbg !19 +// CHECK:STDOUT: %A.by_ref.call = call i32 @_ZN1A6by_refEv(ptr %a), !dbg !19 +// CHECK:STDOUT: ret i32 %A.by_ref.call, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN4Base5virt0Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 @@ -208,10 +209,10 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: define linkonce_odr dso_local noundef i32 @_ZN1A6by_refEv(ptr noundef nonnull align 8 dereferenceable(12) %this) #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !21 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %n = getelementptr inbounds nuw %struct.A, ptr %this1, i32 0, i32 1 -// CHECK:STDOUT: %0 = load i32, ptr %n, align 8, !tbaa !23 +// CHECK:STDOUT: %0 = load i32, ptr %n, align 8, !tbaa !24 // CHECK:STDOUT: ret i32 %0 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -233,25 +234,26 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !15} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !16 = !{!17} -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !11, type: !15) -// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !20 = !{!21, !21, i64 0} -// CHECK:STDOUT: !21 = !{!"p1 _ZTS1A", !22, i64 0} -// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !23 = !{!24, !8, i64 8} -// CHECK:STDOUT: !24 = !{!"_ZTS1A", !25, i64 0, !8, i64 8} -// CHECK:STDOUT: !25 = !{!"_ZTS4Base"} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !17) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !16} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !17 = !{!18} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !12, type: !16) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !21 = !{!22, !22, i64 0} +// CHECK:STDOUT: !22 = !{!"p1 _ZTS1A", !23, i64 0} +// CHECK:STDOUT: !23 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !24 = !{!25, !9, i64 8} +// CHECK:STDOUT: !25 = !{!"_ZTS1A", !26, i64 0, !9, i64 8} +// CHECK:STDOUT: !26 = !{!"_ZTS4Base"} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_virtual.carbon' @@ -265,18 +267,18 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: @_ZTI4Base = external constant ptr // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CUseVal.Main(ptr %a) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CUseVal.Main(ptr %a) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_4.3.vptr = getelementptr inbounds nuw [8 x i8], ptr %a, i32 0, i32 0, !dbg !17 -// CHECK:STDOUT: %Base.virt0.call.vtable = load ptr, ptr %.loc7_4.3.vptr, align 8, !dbg !17 -// CHECK:STDOUT: %Base.virt0.call = getelementptr ptr, ptr %Base.virt0.call.vtable, i32 0, !dbg !17 -// CHECK:STDOUT: %Base.virt0.call.memptr.virtualfn = load ptr, ptr %Base.virt0.call, align 8, !dbg !17 -// CHECK:STDOUT: call void %Base.virt0.call.memptr.virtualfn(ptr %.loc7_4.3.vptr), !dbg !17 -// CHECK:STDOUT: %A.virt1.call.vtable = load ptr, ptr %a, align 8, !dbg !18 -// CHECK:STDOUT: %A.virt1.call = getelementptr ptr, ptr %A.virt1.call.vtable, i32 1, !dbg !18 -// CHECK:STDOUT: %A.virt1.call.memptr.virtualfn = load ptr, ptr %A.virt1.call, align 8, !dbg !18 -// CHECK:STDOUT: call void %A.virt1.call.memptr.virtualfn(ptr %a), !dbg !18 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: %.loc7_4.3.vptr = getelementptr inbounds nuw [8 x i8], ptr %a, i32 0, i32 0, !dbg !18 +// CHECK:STDOUT: %Base.virt0.call.vtable = load ptr, ptr %.loc7_4.3.vptr, align 8, !dbg !18 +// CHECK:STDOUT: %Base.virt0.call = getelementptr ptr, ptr %Base.virt0.call.vtable, i32 0, !dbg !18 +// CHECK:STDOUT: %Base.virt0.call.memptr.virtualfn = load ptr, ptr %Base.virt0.call, align 8, !dbg !18 +// CHECK:STDOUT: call void %Base.virt0.call.memptr.virtualfn(ptr %.loc7_4.3.vptr), !dbg !18 +// CHECK:STDOUT: %A.virt1.call.vtable = load ptr, ptr %a, align 8, !dbg !19 +// CHECK:STDOUT: %A.virt1.call = getelementptr ptr, ptr %A.virt1.call.vtable, i32 1, !dbg !19 +// CHECK:STDOUT: %A.virt1.call.memptr.virtualfn = load ptr, ptr %A.virt1.call, align 8, !dbg !19 +// CHECK:STDOUT: call void %A.virt1.call.memptr.virtualfn(ptr %a), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN4Base5virt0Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 @@ -300,19 +302,20 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 8, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 6, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 8, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 6, column: 1, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_thunk.carbon' @@ -325,17 +328,17 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: @int_1.f1e = internal constant i8 1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall.Main(ptr %n) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CCall.Main(ptr %n) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_14.3.temp = alloca i8, align 1, !dbg !17 -// CHECK:STDOUT: %.loc8_14.3.temp = alloca i8, align 1, !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_14.3.temp), !dbg !17 -// CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk.__(ptr %n, ptr @int_1.f1e), !dbg !19 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_14.3.temp), !dbg !18 -// CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk.__(ptr %n, ptr @int_1.f1e), !dbg !20 +// CHECK:STDOUT: %.loc7_14.3.temp = alloca i8, align 1, !dbg !18 +// CHECK:STDOUT: %.loc8_14.3.temp = alloca i8, align 1, !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_14.3.temp), !dbg !18 +// CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk.__(ptr %n, ptr @int_1.f1e), !dbg !20 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_14.3.temp), !dbg !19 +// CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk.__(ptr %n, ptr @int_1.f1e), !dbg !21 +// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr @int_1.f1e), !dbg !19 // CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr @int_1.f1e), !dbg !18 -// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr @int_1.f1e), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: ret void, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -343,11 +346,11 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %c.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !22 -// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !25 -// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !22, !nonnull !27 -// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8, !tbaa !25 -// CHECK:STDOUT: %2 = load i8, ptr %1, align 1, !tbaa !28 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !23 +// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !26 +// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !23, !nonnull !28 +// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8, !tbaa !26 +// CHECK:STDOUT: %2 = load i8, ptr %1, align 1, !tbaa !29 // CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef signext %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -358,19 +361,19 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %c.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.NeedThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !22 -// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !25 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !22 -// CHECK:STDOUT: %2 = load ptr, ptr %c.addr, align 8, !tbaa !25 -// CHECK:STDOUT: %3 = load i8, ptr %2, align 1, !tbaa !28 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !23 +// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !26 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %2 = load ptr, ptr %c.addr, align 8, !tbaa !26 +// CHECK:STDOUT: %3 = load i8, ptr %2, align 1, !tbaa !29 // CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a(i8 noundef signext %3) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %self) #0 !dbg !29 { +// CHECK:STDOUT: define weak_odr void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %self) #0 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -400,35 +403,36 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 14, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 8, column: 14, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 8, column: 3, scope: !11) -// CHECK:STDOUT: !21 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !22 = !{!23, !23, i64 0} -// CHECK:STDOUT: !23 = !{!"p1 _ZTS9NeedThunk", !24, i64 0} -// CHECK:STDOUT: !24 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !25 = !{!26, !26, i64 0} -// CHECK:STDOUT: !26 = !{!"p1 omnipotent char", !24, i64 0} -// CHECK:STDOUT: !27 = !{} -// CHECK:STDOUT: !28 = !{!9, !9, i64 0} -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.578b3934f85dbca6:core.Destroy.Core", scope: null, file: !1, line: 8, type: !30, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) -// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) -// CHECK:STDOUT: !31 = !{null, !32} -// CHECK:STDOUT: !32 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed) -// CHECK:STDOUT: !33 = !{!34} -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !29, type: !32) -// CHECK:STDOUT: !35 = !DILocation(line: 8, column: 14, scope: !29) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 14, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 8, column: 14, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 8, column: 3, scope: !12) +// CHECK:STDOUT: !22 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !23 = !{!24, !24, i64 0} +// CHECK:STDOUT: !24 = !{!"p1 _ZTS9NeedThunk", !25, i64 0} +// CHECK:STDOUT: !25 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !26 = !{!27, !27, i64 0} +// CHECK:STDOUT: !27 = !{!"p1 omnipotent char", !25, i64 0} +// CHECK:STDOUT: !28 = !{} +// CHECK:STDOUT: !29 = !{!10, !10, i64 0} +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.578b3934f85dbca6:core.Destroy.Core", scope: null, file: !1, line: 8, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34) +// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) +// CHECK:STDOUT: !32 = !{null, !33} +// CHECK:STDOUT: !33 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !30, type: !33) +// CHECK:STDOUT: !36 = !DILocation(line: 8, column: 14, scope: !30) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_with_ref_self.carbon' @@ -437,10 +441,10 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main(ptr %r) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CF.Main(ptr %r) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1A1fEii(ptr %r, i32 1, i32 2), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: call void @_ZN1A1fEii(ptr %r, i32 1, i32 2), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN1A1fEii(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, i32 noundef) #1 @@ -459,16 +463,17 @@ fn F(ref r: Cpp.A) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 11, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 11, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 11, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 1, scope: !12) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon b/toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon index 3d3f820ed3a1f..fe4fa48f02dc0 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon @@ -122,30 +122,30 @@ fn AccessD(d: Cpp.D) -> i32 { // CHECK:STDOUT: @_ZTT1B = linkonce_odr dso_local unnamed_addr constant [1 x ptr] [ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr] }, ptr @_ZTV1B, i32 0, i32 0, i32 3)], comdat, align 8 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMake.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CMake.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [40 x i8], align 8, !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !14 -// CHECK:STDOUT: call void @_ZN1DC1Ev.carbon_thunk.(ptr %_.var), !dbg !15 -// CHECK:STDOUT: ret void, !dbg !16 +// CHECK:STDOUT: %_.var = alloca [40 x i8], align 8, !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !15 +// CHECK:STDOUT: call void @_ZN1DC1Ev.carbon_thunk.(ptr %_.var), !dbg !16 +// CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN1DC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !18 // CHECK:STDOUT: call void @_ZN1DC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessD.Main(ptr %d) #0 !dbg !20 { +// CHECK:STDOUT: define i32 @_CAccessD.Main(ptr %d) #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc16_11.1.d = getelementptr inbounds nuw [40 x i8], ptr %d, i32 0, i32 28, !dbg !27 -// CHECK:STDOUT: %.loc16_11.2 = load i32, ptr %.loc16_11.1.d, align 4, !dbg !27 -// CHECK:STDOUT: ret i32 %.loc16_11.2, !dbg !28 +// CHECK:STDOUT: %.loc16_11.1.d = getelementptr inbounds nuw [40 x i8], ptr %d, i32 0, i32 28, !dbg !28 +// CHECK:STDOUT: %.loc16_11.2 = load i32, ptr %.loc16_11.1.d, align 4, !dbg !28 +// CHECK:STDOUT: ret i32 %.loc16_11.2, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -155,16 +155,16 @@ fn AccessD(d: Cpp.D) -> i32 { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1DC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !18 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %0 = getelementptr inbounds i8, ptr %this1, i64 32 // CHECK:STDOUT: call void @_ZN1AC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) // CHECK:STDOUT: call void @_ZN1BC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %this1, ptr noundef getelementptr inbounds nuw (i8, ptr @_ZTT1D, i64 8)) // CHECK:STDOUT: %1 = getelementptr inbounds i8, ptr %this1, i64 16 // CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 8 dereferenceable(12) %1, ptr noundef getelementptr inbounds nuw (i8, ptr @_ZTT1D, i64 16)) -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr], [3 x ptr] }, ptr @_ZTV1D, i32 0, i32 0, i32 3), ptr %this1, align 8, !tbaa !29 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr], [3 x ptr] }, ptr @_ZTV1D, i32 0, i32 0, i32 3), ptr %this1, align 8, !tbaa !30 // CHECK:STDOUT: %add.ptr = getelementptr inbounds i8, ptr %this1, i64 16 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr], [3 x ptr] }, ptr @_ZTV1D, i32 0, i32 1, i32 3), ptr %add.ptr, align 8, !tbaa !29 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr], [3 x ptr] }, ptr @_ZTV1D, i32 0, i32 1, i32 3), ptr %add.ptr, align 8, !tbaa !30 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -198,28 +198,29 @@ fn AccessD(d: Cpp.D) -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 11, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 11, column: 18, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !17 = !{!18, !18, i64 0} -// CHECK:STDOUT: !18 = !{!"p1 _ZTS1D", !19, i64 0} -// CHECK:STDOUT: !19 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "AccessD", linkageName: "_CAccessD.Main", scope: null, file: !1, line: 14, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !25) -// CHECK:STDOUT: !21 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !22 = !{!23, !24} -// CHECK:STDOUT: !23 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !25 = !{!26} -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !20, type: !24) -// CHECK:STDOUT: !27 = !DILocation(line: 16, column: 10, scope: !20) -// CHECK:STDOUT: !28 = !DILocation(line: 16, column: 3, scope: !20) -// CHECK:STDOUT: !29 = !{!30, !30, i64 0} -// CHECK:STDOUT: !30 = !{!"vtable pointer", !10, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 11, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 11, column: 18, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !18 = !{!19, !19, i64 0} +// CHECK:STDOUT: !19 = !{!"p1 _ZTS1D", !20, i64 0} +// CHECK:STDOUT: !20 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "AccessD", linkageName: "_CAccessD.Main", scope: null, file: !1, line: 14, type: !22, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{!24, !25} +// CHECK:STDOUT: !24 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !21, type: !25) +// CHECK:STDOUT: !28 = !DILocation(line: 16, column: 10, scope: !21) +// CHECK:STDOUT: !29 = !DILocation(line: 16, column: 3, scope: !21) +// CHECK:STDOUT: !30 = !{!31, !31, i64 0} +// CHECK:STDOUT: !31 = !{!"vtable pointer", !11, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon b/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon index 85d9559062e1d..f70d6fdcd5a99 100644 --- a/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon @@ -98,8 +98,8 @@ void delete_new_Base() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %p) #8 // CHECK:STDOUT: %call = call noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #10 // CHECK:STDOUT: call void @_ZN6Carbon5FinalC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %call) #8 -// CHECK:STDOUT: store ptr %call, ptr %p, align 8, !tbaa !11 -// CHECK:STDOUT: %0 = load ptr, ptr %p, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %call, ptr %p, align 8, !tbaa !12 +// CHECK:STDOUT: %0 = load ptr, ptr %p, align 8, !tbaa !12 // CHECK:STDOUT: %isnull = icmp eq ptr %0, null // CHECK:STDOUT: br i1 %isnull, label %delete.end, label %delete.notnull // CHECK:STDOUT: @@ -123,10 +123,10 @@ void delete_new_Base() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon5FinalC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_ZN1AC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this1) #8 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 32) ({ [6 x ptr] }, ptr @_ZTVN6Carbon5FinalE, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !14 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 32) ({ [6 x ptr] }, ptr @_ZTVN6Carbon5FinalE, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !15 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -134,7 +134,7 @@ void delete_new_Base() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon5FinalD2Ev(ptr noundef nonnull align 8 dead_on_return(8) dereferenceable(8) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.Final.Main"(ptr noundef nonnull align 8 dereferenceable(8) %this1) // CHECK:STDOUT: call void @_ZN1AD2Ev(ptr noundef nonnull align 8 dead_on_return(8) dereferenceable(8) %this1) #8 @@ -154,13 +154,13 @@ void delete_new_Base() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %p) #8 // CHECK:STDOUT: %call = call noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #10 // CHECK:STDOUT: call void @_ZN6Carbon4BaseC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %call) #8 -// CHECK:STDOUT: store ptr %call, ptr %p, align 8, !tbaa !16 -// CHECK:STDOUT: %0 = load ptr, ptr %p, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %call, ptr %p, align 8, !tbaa !17 +// CHECK:STDOUT: %0 = load ptr, ptr %p, align 8, !tbaa !17 // CHECK:STDOUT: %isnull = icmp eq ptr %0, null // CHECK:STDOUT: br i1 %isnull, label %delete.end, label %delete.notnull // CHECK:STDOUT: // CHECK:STDOUT: delete.notnull: ; preds = %entry -// CHECK:STDOUT: %vtable = load ptr, ptr %0, align 8, !tbaa !14 +// CHECK:STDOUT: %vtable = load ptr, ptr %0, align 8, !tbaa !15 // CHECK:STDOUT: %vfn = getelementptr inbounds ptr, ptr %vtable, i64 1 // CHECK:STDOUT: %1 = load ptr, ptr %vfn, align 8 // CHECK:STDOUT: call void %1(ptr noundef nonnull align 8 dereferenceable(8) %0) #8 @@ -175,10 +175,10 @@ void delete_new_Base() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon4BaseC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_ZN1AC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this1) #8 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 32) ({ [6 x ptr] }, ptr @_ZTVN6Carbon4BaseE, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !14 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 32) ({ [6 x ptr] }, ptr @_ZTVN6Carbon4BaseE, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !15 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -186,9 +186,9 @@ void delete_new_Base() { // CHECK:STDOUT: define internal void @_ZNK1A1FEv.carbon_thunk._(ptr noundef nonnull align 8 dereferenceable(8) %this) #5 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !18 -// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !18, !nonnull !20, !align !21 -// CHECK:STDOUT: %vtable = load ptr, ptr %0, align 8, !tbaa !14 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !19 +// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !19, !nonnull !21, !align !22 +// CHECK:STDOUT: %vtable = load ptr, ptr %0, align 8, !tbaa !15 // CHECK:STDOUT: %vfn = getelementptr inbounds ptr, ptr %vtable, i64 2 // CHECK:STDOUT: %1 = load ptr, ptr %vfn, align 8 // CHECK:STDOUT: call void %1(ptr noundef nonnull align 8 dereferenceable(8) %0) @@ -198,68 +198,68 @@ void delete_new_Base() { // CHECK:STDOUT: declare void @_CF.Final.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_CF:thunk:A.Cpp:Final.Main"(ptr %self) #6 !dbg !22 { +// CHECK:STDOUT: define void @"_CF:thunk:A.Cpp:Final.Main"(ptr %self) #6 !dbg !23 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Final.Main(ptr %self), !dbg !28 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: call void @_CF.Final.Main(ptr %self), !dbg !29 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CF.Base.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_CF:thunk:A.Cpp:Base.Main"(ptr %self) #6 !dbg !29 { +// CHECK:STDOUT: define void @"_CF:thunk:A.Cpp:Base.Main"(ptr %self) #6 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Base.Main(ptr %self), !dbg !32 -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: call void @_CF.Base.Main(ptr %self), !dbg !33 +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.Final.Main"(ptr %self) #6 !dbg !33 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.Final.Main"(ptr %self) #6 !dbg !34 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.6622c02ec7a967c3:core.Destroy.Core"(ptr %self), !dbg !36 -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: call void @"_COp.6622c02ec7a967c3:core.Destroy.Core"(ptr %self), !dbg !37 +// CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: declare void @_ZN1AD1Ev(ptr noundef nonnull align 8 dead_on_return(8) dereferenceable(8)) unnamed_addr #7 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.4fc2347fc019a955:core.Destroy.Core"(ptr %self) #8 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_COp.4fc2347fc019a955:core.Destroy.Core"(ptr %self) #8 !dbg !38 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: ret void, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6622c02ec7a967c3:core.Destroy.Core"(ptr %self) #8 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_COp.6622c02ec7a967c3:core.Destroy.Core"(ptr %self) #8 !dbg !42 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: ret void, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.Final.Main(ptr %self) #8 !dbg !45 { +// CHECK:STDOUT: define void @_CF__carbon_thunk.Final.Main(ptr %self) #8 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Final.Main(ptr %self), !dbg !48 -// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: call void @_CF.Final.Main(ptr %self), !dbg !49 +// CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.Base.Main"(ptr %self) #6 !dbg !49 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.Base.Main"(ptr %self) #6 !dbg !50 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.a45b619846c20518:core.Destroy.Core"(ptr %self), !dbg !52 -// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: call void @"_COp.a45b619846c20518:core.Destroy.Core"(ptr %self), !dbg !53 +// CHECK:STDOUT: ret void, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.a45b619846c20518:core.Destroy.Core"(ptr %self) #8 !dbg !53 { +// CHECK:STDOUT: define weak_odr void @"_COp.a45b619846c20518:core.Destroy.Core"(ptr %self) #8 !dbg !54 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !56 +// CHECK:STDOUT: ret void, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.Base.Main(ptr %self) #8 !dbg !57 { +// CHECK:STDOUT: define void @_CF__carbon_thunk.Base.Main(ptr %self) #8 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Base.Main(ptr %self), !dbg !60 -// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: call void @_CF.Base.Main(ptr %self), !dbg !61 +// CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @__cxa_pure_virtual() unnamed_addr @@ -270,7 +270,7 @@ void delete_new_Base() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon5FinalD0Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_ZN6Carbon5FinalD2Ev(ptr noundef nonnull align 8 dead_on_return(8) dereferenceable(8) %this1) #8 // CHECK:STDOUT: call void @_ZdlPvm(ptr noundef %this1, i64 noundef 8) #11 @@ -281,7 +281,7 @@ void delete_new_Base() { // CHECK:STDOUT: define internal void @_ZN6Carbon5Final1FEv(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #5 align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_CF__carbon_thunk.Final.Main(ptr noundef nonnull align 8 dereferenceable(8) %this1) // CHECK:STDOUT: ret void @@ -291,9 +291,9 @@ void delete_new_Base() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon4BaseD2Ev(ptr noundef nonnull align 8 dead_on_return(8) dereferenceable(8) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 32) ({ [6 x ptr] }, ptr @_ZTVN6Carbon4BaseE, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !14 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 32) ({ [6 x ptr] }, ptr @_ZTVN6Carbon4BaseE, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !15 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.Base.Main"(ptr noundef nonnull align 8 dereferenceable(8) %this1) // CHECK:STDOUT: call void @_ZN1AD2Ev(ptr noundef nonnull align 8 dead_on_return(8) dereferenceable(8) %this1) #8 // CHECK:STDOUT: ret void @@ -303,7 +303,7 @@ void delete_new_Base() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon4BaseD0Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_ZN6Carbon4BaseD2Ev(ptr noundef nonnull align 8 dead_on_return(8) dereferenceable(8) %this1) #8 // CHECK:STDOUT: call void @_ZdlPvm(ptr noundef %this1, i64 noundef 8) #11 @@ -314,7 +314,7 @@ void delete_new_Base() { // CHECK:STDOUT: define internal void @_ZN6Carbon4Base1FEv(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #5 align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !16 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !17 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_CF__carbon_thunk.Base.Main(ptr noundef nonnull align 8 dereferenceable(8) %this1) // CHECK:STDOUT: ret void @@ -324,9 +324,9 @@ void delete_new_Base() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1AC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !18 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !19 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTV1A, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !14 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-16, 24) ({ [5 x ptr] }, ptr @_ZTV1A, i32 0, i32 0, i32 2), ptr %this1, align 8, !tbaa !15 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -365,58 +365,59 @@ void delete_new_Base() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTSN6Carbon5FinalE", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = !{!15, !15, i64 0} -// CHECK:STDOUT: !15 = !{!"vtable pointer", !10, i64 0} -// CHECK:STDOUT: !16 = !{!17, !17, i64 0} -// CHECK:STDOUT: !17 = !{!"p1 _ZTSN6Carbon4BaseE", !13, i64 0} -// CHECK:STDOUT: !18 = !{!19, !19, i64 0} -// CHECK:STDOUT: !19 = !{!"p1 _ZTS1A", !13, i64 0} -// CHECK:STDOUT: !20 = !{} -// CHECK:STDOUT: !21 = !{i64 8} -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:A.Cpp:Final.Main", scope: null, file: !1, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) -// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) -// CHECK:STDOUT: !24 = !{null, !25} -// CHECK:STDOUT: !25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !26 = !{!27} -// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !22, type: !25) -// CHECK:STDOUT: !28 = !DILocation(line: 14, column: 3, scope: !22) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:A.Cpp:Base.Main", scope: null, file: !1, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) -// CHECK:STDOUT: !30 = !{!31} -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !25) -// CHECK:STDOUT: !32 = !DILocation(line: 19, column: 3, scope: !29) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.Final.Main", scope: null, file: !1, line: 12, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34) -// CHECK:STDOUT: !34 = !{!35} -// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !25) -// CHECK:STDOUT: !36 = !DILocation(line: 12, column: 1, scope: !33) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4fc2347fc019a955:core.Destroy.Core", scope: null, file: !1, line: 12, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38) -// CHECK:STDOUT: !38 = !{!39} -// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !25) -// CHECK:STDOUT: !40 = !DILocation(line: 12, column: 1, scope: !37) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6622c02ec7a967c3:core.Destroy.Core", scope: null, file: !1, line: 12, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !42) -// CHECK:STDOUT: !42 = !{!43} -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !25) -// CHECK:STDOUT: !44 = !DILocation(line: 12, column: 1, scope: !41) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Final.Main", scope: null, file: !1, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !46) -// CHECK:STDOUT: !46 = !{!47} -// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !25) -// CHECK:STDOUT: !48 = !DILocation(line: 14, column: 3, scope: !45) -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.Base.Main", scope: null, file: !1, line: 17, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !50) -// CHECK:STDOUT: !50 = !{!51} -// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !25) -// CHECK:STDOUT: !52 = !DILocation(line: 17, column: 1, scope: !49) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a45b619846c20518:core.Destroy.Core", scope: null, file: !1, line: 17, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !54) -// CHECK:STDOUT: !54 = !{!55} -// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !25) -// CHECK:STDOUT: !56 = !DILocation(line: 17, column: 1, scope: !53) -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Base.Main", scope: null, file: !1, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !58) -// CHECK:STDOUT: !58 = !{!59} -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !57, type: !25) -// CHECK:STDOUT: !60 = !DILocation(line: 19, column: 3, scope: !57) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon5FinalE", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = !{!16, !16, i64 0} +// CHECK:STDOUT: !16 = !{!"vtable pointer", !11, i64 0} +// CHECK:STDOUT: !17 = !{!18, !18, i64 0} +// CHECK:STDOUT: !18 = !{!"p1 _ZTSN6Carbon4BaseE", !14, i64 0} +// CHECK:STDOUT: !19 = !{!20, !20, i64 0} +// CHECK:STDOUT: !20 = !{!"p1 _ZTS1A", !14, i64 0} +// CHECK:STDOUT: !21 = !{} +// CHECK:STDOUT: !22 = !{i64 8} +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:A.Cpp:Final.Main", scope: null, file: !1, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !27) +// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) +// CHECK:STDOUT: !25 = !{null, !26} +// CHECK:STDOUT: !26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !23, type: !26) +// CHECK:STDOUT: !29 = !DILocation(line: 14, column: 3, scope: !23) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "F", linkageName: "_CF:thunk:A.Cpp:Base.Main", scope: null, file: !1, line: 19, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !26) +// CHECK:STDOUT: !33 = !DILocation(line: 19, column: 3, scope: !30) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.Final.Main", scope: null, file: !1, line: 12, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !35) +// CHECK:STDOUT: !35 = !{!36} +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !26) +// CHECK:STDOUT: !37 = !DILocation(line: 12, column: 1, scope: !34) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4fc2347fc019a955:core.Destroy.Core", scope: null, file: !1, line: 12, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !39) +// CHECK:STDOUT: !39 = !{!40} +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !26) +// CHECK:STDOUT: !41 = !DILocation(line: 12, column: 1, scope: !38) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6622c02ec7a967c3:core.Destroy.Core", scope: null, file: !1, line: 12, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43) +// CHECK:STDOUT: !43 = !{!44} +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !42, type: !26) +// CHECK:STDOUT: !45 = !DILocation(line: 12, column: 1, scope: !42) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Final.Main", scope: null, file: !1, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !47) +// CHECK:STDOUT: !47 = !{!48} +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !26) +// CHECK:STDOUT: !49 = !DILocation(line: 14, column: 3, scope: !46) +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.Base.Main", scope: null, file: !1, line: 17, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !51) +// CHECK:STDOUT: !51 = !{!52} +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !50, type: !26) +// CHECK:STDOUT: !53 = !DILocation(line: 17, column: 1, scope: !50) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp.a45b619846c20518:core.Destroy.Core", scope: null, file: !1, line: 17, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !55) +// CHECK:STDOUT: !55 = !{!56} +// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !54, type: !26) +// CHECK:STDOUT: !57 = !DILocation(line: 17, column: 1, scope: !54) +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Base.Main", scope: null, file: !1, line: 19, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !59) +// CHECK:STDOUT: !59 = !{!60} +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !58, type: !26) +// CHECK:STDOUT: !61 = !DILocation(line: 19, column: 3, scope: !58) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/debug_info.carbon b/toolchain/lower/testdata/interop/cpp/debug_info.carbon index 67b39f039bf9d..00879edec1f41 100644 --- a/toolchain/lower/testdata/interop/cpp/debug_info.carbon +++ b/toolchain/lower/testdata/interop/cpp/debug_info.carbon @@ -29,16 +29,16 @@ fn Call() -> i32 { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable -// CHECK:STDOUT: define dso_local noundef i32 @_Z1fv() #0 !dbg !13 { +// CHECK:STDOUT: define dso_local noundef i32 @_Z1fv() #0 !dbg !14 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 42, !dbg !17 +// CHECK:STDOUT: ret i32 42, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CCall.Main() #1 !dbg !18 { +// CHECK:STDOUT: define i32 @_CCall.Main() #1 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %f.call = call i32 @_Z1fv(), !dbg !19 -// CHECK:STDOUT: ret i32 %f.call, !dbg !20 +// CHECK:STDOUT: %f.call = call i32 @_Z1fv(), !dbg !20 +// CHECK:STDOUT: ret i32 %f.call, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -57,16 +57,17 @@ fn Call() -> i32 { // CHECK:STDOUT: !6 = !{i32 8, !"PIC Level", i32 2} // CHECK:STDOUT: !7 = !{i32 7, !"PIE Level", i32 2} // CHECK:STDOUT: !8 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !9 = !{!10, !10, i64 0} -// CHECK:STDOUT: !10 = !{!"int", !11, i64 0} -// CHECK:STDOUT: !11 = !{!"omnipotent char", !12, i64 0} -// CHECK:STDOUT: !12 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", scope: !3, file: !3, line: 18, type: !14, scopeLine: 18, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true) -// CHECK:STDOUT: !14 = !DISubroutineType(types: !15) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !17 = !DILocation(line: 18, column: 11, scope: !13, atomGroup: 1, atomRank: 1) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !3, line: 21, type: !14, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !19 = !DILocation(line: 22, column: 10, scope: !18) -// CHECK:STDOUT: !20 = !DILocation(line: 22, column: 3, scope: !18) +// CHECK:STDOUT: !9 = !{!10, !11, i64 0} +// CHECK:STDOUT: !10 = !{!"__libc_errno", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"int", !12, i64 0} +// CHECK:STDOUT: !12 = !{!"omnipotent char", !13, i64 0} +// CHECK:STDOUT: !13 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", scope: !3, file: !3, line: 18, type: !15, scopeLine: 18, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true) +// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !18 = !DILocation(line: 18, column: 11, scope: !14, atomGroup: 1, atomRank: 1) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !3, line: 21, type: !15, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !20 = !DILocation(line: 22, column: 10, scope: !19) +// CHECK:STDOUT: !21 = !DILocation(line: 22, column: 3, scope: !19) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/enum.carbon b/toolchain/lower/testdata/interop/cpp/enum.carbon index 0d0411535ff72..52bf1ed2f2c00 100644 --- a/toolchain/lower/testdata/interop/cpp/enum.carbon +++ b/toolchain/lower/testdata/interop/cpp/enum.carbon @@ -167,39 +167,39 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: @int_8 = internal constant i16 8 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPass.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CPass.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_16.1.temp = alloca i16, align 2, !dbg !14 -// CHECK:STDOUT: %.loc8_16.1.temp = alloca i16, align 2, !dbg !15 -// CHECK:STDOUT: %.loc9_16.1.temp = alloca i16, align 2, !dbg !16 -// CHECK:STDOUT: %.loc10_16.1.temp = alloca i16, align 2, !dbg !17 -// CHECK:STDOUT: %.loc11_18.1.temp = alloca i16, align 2, !dbg !18 -// CHECK:STDOUT: %.loc12_18.1.temp = alloca i16, align 2, !dbg !19 -// CHECK:STDOUT: %.loc13_18.1.temp = alloca i16, align 2, !dbg !20 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_16.1.temp), !dbg !14 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_0), !dbg !21 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_16.1.temp), !dbg !15 +// CHECK:STDOUT: %.loc7_16.1.temp = alloca i16, align 2, !dbg !15 +// CHECK:STDOUT: %.loc8_16.1.temp = alloca i16, align 2, !dbg !16 +// CHECK:STDOUT: %.loc9_16.1.temp = alloca i16, align 2, !dbg !17 +// CHECK:STDOUT: %.loc10_16.1.temp = alloca i16, align 2, !dbg !18 +// CHECK:STDOUT: %.loc11_18.1.temp = alloca i16, align 2, !dbg !19 +// CHECK:STDOUT: %.loc12_18.1.temp = alloca i16, align 2, !dbg !20 +// CHECK:STDOUT: %.loc13_18.1.temp = alloca i16, align 2, !dbg !21 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_16.1.temp), !dbg !15 // CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_0), !dbg !22 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_16.1.temp), !dbg !16 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_7), !dbg !23 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc10_16.1.temp), !dbg !17 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_8), !dbg !24 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_18.1.temp), !dbg !18 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_0), !dbg !25 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_18.1.temp), !dbg !19 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_7), !dbg !26 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_18.1.temp), !dbg !20 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_8), !dbg !27 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_16.1.temp), !dbg !16 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_0), !dbg !23 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_16.1.temp), !dbg !17 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_7), !dbg !24 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc10_16.1.temp), !dbg !18 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_8), !dbg !25 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_18.1.temp), !dbg !19 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_0), !dbg !26 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_18.1.temp), !dbg !20 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_7), !dbg !27 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_18.1.temp), !dbg !21 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr @int_8), !dbg !28 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN1C1FENS_1EE.carbon_thunk._(ptr noundef %0) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !29 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !29 -// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !31 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !30 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !30 +// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !32 // CHECK:STDOUT: call void @_ZN1C1FENS_1EE(i16 noundef signext %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -229,32 +229,33 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Pass", linkageName: "_CPass.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 11, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 11, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 11, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 10, column: 11, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 11, column: 11, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 12, column: 11, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 13, column: 11, scope: !11) -// CHECK:STDOUT: !21 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !22 = !DILocation(line: 8, column: 3, scope: !11) -// CHECK:STDOUT: !23 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !24 = !DILocation(line: 10, column: 3, scope: !11) -// CHECK:STDOUT: !25 = !DILocation(line: 11, column: 3, scope: !11) -// CHECK:STDOUT: !26 = !DILocation(line: 12, column: 3, scope: !11) -// CHECK:STDOUT: !27 = !DILocation(line: 13, column: 3, scope: !11) -// CHECK:STDOUT: !28 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !29 = !{!30, !30, i64 0} -// CHECK:STDOUT: !30 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !31 = !{!32, !32, i64 0} -// CHECK:STDOUT: !32 = !{!"_ZTSN1C1EE", !9, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Pass", linkageName: "_CPass.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 11, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 11, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 11, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 10, column: 11, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 11, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 12, column: 11, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 13, column: 11, scope: !12) +// CHECK:STDOUT: !22 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !23 = !DILocation(line: 8, column: 3, scope: !12) +// CHECK:STDOUT: !24 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !25 = !DILocation(line: 10, column: 3, scope: !12) +// CHECK:STDOUT: !26 = !DILocation(line: 11, column: 3, scope: !12) +// CHECK:STDOUT: !27 = !DILocation(line: 12, column: 3, scope: !12) +// CHECK:STDOUT: !28 = !DILocation(line: 13, column: 3, scope: !12) +// CHECK:STDOUT: !29 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !30 = !{!31, !31, i64 0} +// CHECK:STDOUT: !31 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !32 = !{!33, !33, i64 0} +// CHECK:STDOUT: !33 = !{!"_ZTSN1C1EE", !10, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'convert.carbon' @@ -265,36 +266,36 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: declare void @_CTakeI16.Main(i16) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassEnum.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CPassEnum.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CTakeI16.Main(i16 7), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: call void @_CTakeI16.Main(i16 7), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertEnumToI16.Main(i16 %e) #0 !dbg !16 { +// CHECK:STDOUT: define void @_CConvertEnumToI16.Main(i16 %e) #0 !dbg !17 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CTakeI16.Main(i16 %e), !dbg !22 -// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: call void @_CTakeI16.Main(i16 %e), !dbg !23 +// CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertI16ToEnum.Main(i16 %n) #0 !dbg !24 { +// CHECK:STDOUT: define void @_CConvertI16ToEnum.Main(i16 %n) #0 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_13.3.temp = alloca i16, align 2, !dbg !27 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_13.3.temp), !dbg !27 -// CHECK:STDOUT: store i16 %n, ptr %.loc17_13.3.temp, align 2, !dbg !27 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr %.loc17_13.3.temp), !dbg !28 -// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: %.loc17_13.3.temp = alloca i16, align 2, !dbg !28 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_13.3.temp), !dbg !28 +// CHECK:STDOUT: store i16 %n, ptr %.loc17_13.3.temp, align 2, !dbg !28 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr %.loc17_13.3.temp), !dbg !29 +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN1C1FENS_1EE.carbon_thunk._(ptr noundef %0) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !30 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !30 -// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !32 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !31 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !31 +// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !33 // CHECK:STDOUT: call void @_ZN1C1FENS_1EE(i16 noundef signext %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -320,33 +321,34 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "PassEnum", linkageName: "_CPassEnum.Main", scope: null, file: !1, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 1, scope: !11) -// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "ConvertEnumToI16", linkageName: "_CConvertEnumToI16.Main", scope: null, file: !1, line: 12, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !20) -// CHECK:STDOUT: !17 = !DISubroutineType(types: !18) -// CHECK:STDOUT: !18 = !{null, !19} -// CHECK:STDOUT: !19 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) -// CHECK:STDOUT: !20 = !{!21} -// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !16, type: !19) -// CHECK:STDOUT: !22 = !DILocation(line: 13, column: 3, scope: !16) -// CHECK:STDOUT: !23 = !DILocation(line: 12, column: 1, scope: !16) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "ConvertI16ToEnum", linkageName: "_CConvertI16ToEnum.Main", scope: null, file: !1, line: 16, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !25) -// CHECK:STDOUT: !25 = !{!26} -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !24, type: !19) -// CHECK:STDOUT: !27 = !DILocation(line: 17, column: 11, scope: !24) -// CHECK:STDOUT: !28 = !DILocation(line: 17, column: 3, scope: !24) -// CHECK:STDOUT: !29 = !DILocation(line: 16, column: 1, scope: !24) -// CHECK:STDOUT: !30 = !{!31, !31, i64 0} -// CHECK:STDOUT: !31 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !32 = !{!33, !33, i64 0} -// CHECK:STDOUT: !33 = !{!"_ZTSN1C1EE", !9, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "PassEnum", linkageName: "_CPassEnum.Main", scope: null, file: !1, line: 8, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 1, scope: !12) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "ConvertEnumToI16", linkageName: "_CConvertEnumToI16.Main", scope: null, file: !1, line: 12, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) +// CHECK:STDOUT: !18 = !DISubroutineType(types: !19) +// CHECK:STDOUT: !19 = !{null, !20} +// CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) +// CHECK:STDOUT: !21 = !{!22} +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !17, type: !20) +// CHECK:STDOUT: !23 = !DILocation(line: 13, column: 3, scope: !17) +// CHECK:STDOUT: !24 = !DILocation(line: 12, column: 1, scope: !17) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "ConvertI16ToEnum", linkageName: "_CConvertI16ToEnum.Main", scope: null, file: !1, line: 16, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !20) +// CHECK:STDOUT: !28 = !DILocation(line: 17, column: 11, scope: !25) +// CHECK:STDOUT: !29 = !DILocation(line: 17, column: 3, scope: !25) +// CHECK:STDOUT: !30 = !DILocation(line: 16, column: 1, scope: !25) +// CHECK:STDOUT: !31 = !{!32, !32, i64 0} +// CHECK:STDOUT: !32 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !33 = !{!34, !34, i64 0} +// CHECK:STDOUT: !34 = !{!"_ZTSN1C1EE", !10, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'use_bitmask.carbon' @@ -355,29 +357,29 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCompileTime.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CCompileTime.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 0), !dbg !14 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 5), !dbg !15 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 0), !dbg !15 // CHECK:STDOUT: call void @_Z4Take4Bits(i32 5), !dbg !16 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 -2), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 5), !dbg !17 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 -2), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z4Take4Bits(i32 noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CRuntime.Main(i32 %a, i32 %b) #0 !dbg !19 { +// CHECK:STDOUT: define void @_CRuntime.Main(i32 %a, i32 %b) #0 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Op.call.loc14 = and i32 %a, %b, !dbg !26 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %Op.call.loc14), !dbg !27 -// CHECK:STDOUT: %Op.call.loc15 = or i32 %a, %b, !dbg !28 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %Op.call.loc15), !dbg !29 -// CHECK:STDOUT: %Op.call.loc16 = xor i32 %a, %b, !dbg !30 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %Op.call.loc16), !dbg !31 -// CHECK:STDOUT: %Op.call.loc20 = xor i32 -1, %a, !dbg !32 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %Op.call.loc20), !dbg !33 -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: %Op.call.loc14 = and i32 %a, %b, !dbg !27 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %Op.call.loc14), !dbg !28 +// CHECK:STDOUT: %Op.call.loc15 = or i32 %a, %b, !dbg !29 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %Op.call.loc15), !dbg !30 +// CHECK:STDOUT: %Op.call.loc16 = xor i32 %a, %b, !dbg !31 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %Op.call.loc16), !dbg !32 +// CHECK:STDOUT: %Op.call.loc20 = xor i32 -1, %a, !dbg !33 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %Op.call.loc20), !dbg !34 +// CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -397,34 +399,35 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "CompileTime", linkageName: "_CCompileTime.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 3, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 10, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Runtime", linkageName: "_CRuntime.Main", scope: null, file: !1, line: 13, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23) -// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !21 = !{null, !22, !22} -// CHECK:STDOUT: !22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) -// CHECK:STDOUT: !23 = !{!24, !25} -// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) -// CHECK:STDOUT: !25 = !DILocalVariable(arg: 2, scope: !19, type: !22) -// CHECK:STDOUT: !26 = !DILocation(line: 14, column: 12, scope: !19) -// CHECK:STDOUT: !27 = !DILocation(line: 14, column: 3, scope: !19) -// CHECK:STDOUT: !28 = !DILocation(line: 15, column: 12, scope: !19) -// CHECK:STDOUT: !29 = !DILocation(line: 15, column: 3, scope: !19) -// CHECK:STDOUT: !30 = !DILocation(line: 16, column: 12, scope: !19) -// CHECK:STDOUT: !31 = !DILocation(line: 16, column: 3, scope: !19) -// CHECK:STDOUT: !32 = !DILocation(line: 20, column: 12, scope: !19) -// CHECK:STDOUT: !33 = !DILocation(line: 20, column: 3, scope: !19) -// CHECK:STDOUT: !34 = !DILocation(line: 13, column: 1, scope: !19) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "CompileTime", linkageName: "_CCompileTime.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 3, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 10, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Runtime", linkageName: "_CRuntime.Main", scope: null, file: !1, line: 13, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24) +// CHECK:STDOUT: !21 = !DISubroutineType(types: !22) +// CHECK:STDOUT: !22 = !{null, !23, !23} +// CHECK:STDOUT: !23 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !24 = !{!25, !26} +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !20, type: !23) +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 2, scope: !20, type: !23) +// CHECK:STDOUT: !27 = !DILocation(line: 14, column: 12, scope: !20) +// CHECK:STDOUT: !28 = !DILocation(line: 14, column: 3, scope: !20) +// CHECK:STDOUT: !29 = !DILocation(line: 15, column: 12, scope: !20) +// CHECK:STDOUT: !30 = !DILocation(line: 15, column: 3, scope: !20) +// CHECK:STDOUT: !31 = !DILocation(line: 16, column: 12, scope: !20) +// CHECK:STDOUT: !32 = !DILocation(line: 16, column: 3, scope: !20) +// CHECK:STDOUT: !33 = !DILocation(line: 20, column: 12, scope: !20) +// CHECK:STDOUT: !34 = !DILocation(line: 20, column: 3, scope: !20) +// CHECK:STDOUT: !35 = !DILocation(line: 13, column: 1, scope: !20) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'compare.carbon' @@ -433,24 +436,24 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCompare.Main(i16 %a, i16 %b) #0 !dbg !11 { +// CHECK:STDOUT: define i1 @_CCompare.Main(i16 %a, i16 %b) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Equal.call = icmp eq i16 %a, %b, !dbg !19 -// CHECK:STDOUT: ret i1 %Equal.call, !dbg !20 +// CHECK:STDOUT: %Equal.call = icmp eq i16 %a, %b, !dbg !20 +// CHECK:STDOUT: ret i1 %Equal.call, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCallCompareGeneric.Main(i16 %a, i16 %b) #0 !dbg !21 { +// CHECK:STDOUT: define i1 @_CCallCompareGeneric.Main(i16 %a, i16 %b) #0 !dbg !22 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.80c3fc0239809458(i16 %a, i16 %b), !dbg !25 -// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !26 +// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.80c3fc0239809458(i16 %a, i16 %b), !dbg !26 +// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.80c3fc0239809458(i16 %x, i16 %y) #0 !dbg !27 { +// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.80c3fc0239809458(i16 %x, i16 %y) #0 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = icmp eq i16 %x, %y, !dbg !31 -// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !32 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = icmp eq i16 %x, %y, !dbg !32 +// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -466,32 +469,33 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Compare", linkageName: "_CCompare.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !15, !15} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) -// CHECK:STDOUT: !16 = !{!17, !18} -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !11, type: !15) -// CHECK:STDOUT: !18 = !DILocalVariable(arg: 2, scope: !11, type: !15) -// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "CallCompareGeneric", linkageName: "_CCallCompareGeneric.Main", scope: null, file: !1, line: 14, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) -// CHECK:STDOUT: !22 = !{!23, !24} -// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !21, type: !15) -// CHECK:STDOUT: !24 = !DILocalVariable(arg: 2, scope: !21, type: !15) -// CHECK:STDOUT: !25 = !DILocation(line: 15, column: 10, scope: !21) -// CHECK:STDOUT: !26 = !DILocation(line: 15, column: 3, scope: !21) -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.80c3fc0239809458", scope: null, file: !1, line: 10, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28) -// CHECK:STDOUT: !28 = !{!29, !30} -// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !27, type: !15) -// CHECK:STDOUT: !30 = !DILocalVariable(arg: 2, scope: !27, type: !15) -// CHECK:STDOUT: !31 = !DILocation(line: 11, column: 10, scope: !27) -// CHECK:STDOUT: !32 = !DILocation(line: 11, column: 3, scope: !27) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Compare", linkageName: "_CCompare.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !17) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !16, !16} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) +// CHECK:STDOUT: !17 = !{!18, !19} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !12, type: !16) +// CHECK:STDOUT: !19 = !DILocalVariable(arg: 2, scope: !12, type: !16) +// CHECK:STDOUT: !20 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "CallCompareGeneric", linkageName: "_CCallCompareGeneric.Main", scope: null, file: !1, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23) +// CHECK:STDOUT: !23 = !{!24, !25} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !22, type: !16) +// CHECK:STDOUT: !25 = !DILocalVariable(arg: 2, scope: !22, type: !16) +// CHECK:STDOUT: !26 = !DILocation(line: 15, column: 10, scope: !22) +// CHECK:STDOUT: !27 = !DILocation(line: 15, column: 3, scope: !22) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.80c3fc0239809458", scope: null, file: !1, line: 10, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !29) +// CHECK:STDOUT: !29 = !{!30, !31} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !28, type: !16) +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 2, scope: !28, type: !16) +// CHECK:STDOUT: !32 = !DILocation(line: 11, column: 10, scope: !28) +// CHECK:STDOUT: !33 = !DILocation(line: 11, column: 3, scope: !28) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'compare_class.carbon' @@ -500,14 +504,14 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCompare.Main(i16 %a, ptr %b) #0 !dbg !11 { +// CHECK:STDOUT: define i1 @_CCompare.Main(i16 %a, ptr %b) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_15.1.temp = alloca i16, align 2, !dbg !19 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_15.1.temp), !dbg !19 -// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %b, ptr %.loc18_15.1.temp), !dbg !19 -// CHECK:STDOUT: %.loc18_15.5 = load i16, ptr %.loc18_15.1.temp, align 2, !dbg !19 -// CHECK:STDOUT: %Equal.call = icmp eq i16 %a, %.loc18_15.5, !dbg !20 -// CHECK:STDOUT: ret i1 %Equal.call, !dbg !21 +// CHECK:STDOUT: %.loc18_15.1.temp = alloca i16, align 2, !dbg !20 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_15.1.temp), !dbg !20 +// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %b, ptr %.loc18_15.1.temp), !dbg !20 +// CHECK:STDOUT: %.loc18_15.5 = load i16, ptr %.loc18_15.1.temp, align 2, !dbg !20 +// CHECK:STDOUT: %Equal.call = icmp eq i16 %a, %.loc18_15.5, !dbg !21 +// CHECK:STDOUT: ret i1 %Equal.call, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -515,42 +519,42 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !22 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !25 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !25 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !22, !nonnull !26 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !23 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !26 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !26 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !23, !nonnull !27 // CHECK:STDOUT: %call = call noundef signext i16 @_ZNK13ConvertToEnumcvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !27 +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !28 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCompare2.Main(i32 %a, ptr %b) #0 !dbg !29 { +// CHECK:STDOUT: define i1 @_CCompare2.Main(i32 %a, ptr %b) #0 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %b), !dbg !36 -// CHECK:STDOUT: %Equal.call = icmp eq i32 %a, %__carbon_thunk.call, !dbg !37 -// CHECK:STDOUT: ret i1 %Equal.call, !dbg !38 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %b), !dbg !37 +// CHECK:STDOUT: %Equal.call = icmp eq i32 %a, %__carbon_thunk.call, !dbg !38 +// CHECK:STDOUT: ret i1 %Equal.call, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal noundef i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr noundef nonnull align 1 dereferenceable(1) %this) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !22 -// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !22, !nonnull !26 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !23, !nonnull !27 // CHECK:STDOUT: %call = call noundef i32 @_ZNK13ConvertToEnumcv2E2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret i32 %call // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCompare3.Main(i16 %a, ptr %b) #0 !dbg !39 { +// CHECK:STDOUT: define i1 @_CCompare3.Main(i16 %a, ptr %b) #0 !dbg !40 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc26_15.1.temp = alloca i16, align 2, !dbg !43 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_15.1.temp), !dbg !43 -// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %b, ptr %.loc26_15.1.temp), !dbg !43 -// CHECK:STDOUT: %.loc26_15.5 = load i16, ptr %.loc26_15.1.temp, align 2, !dbg !43 -// CHECK:STDOUT: %Equal.call = icmp eq i16 %a, %.loc26_15.5, !dbg !44 -// CHECK:STDOUT: ret i1 %Equal.call, !dbg !45 +// CHECK:STDOUT: %.loc26_15.1.temp = alloca i16, align 2, !dbg !44 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_15.1.temp), !dbg !44 +// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %b, ptr %.loc26_15.1.temp), !dbg !44 +// CHECK:STDOUT: %.loc26_15.5 = load i16, ptr %.loc26_15.1.temp, align 2, !dbg !44 +// CHECK:STDOUT: %Equal.call = icmp eq i16 %a, %.loc26_15.5, !dbg !45 +// CHECK:STDOUT: ret i1 %Equal.call, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -558,118 +562,118 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !46 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !25 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !25 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !46, !nonnull !26 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !47 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !26 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !26 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !47, !nonnull !27 // CHECK:STDOUT: %call = call noundef signext i16 @_ZNK14ConvertToEnum2cvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !27 +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !28 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCallCompareGeneric.Main(i16 %a, ptr %b) #0 !dbg !48 { +// CHECK:STDOUT: define i1 @_CCallCompareGeneric.Main(i16 %a, ptr %b) #0 !dbg !49 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.215a23369ed4d589(i16 %a, ptr %b), !dbg !52 -// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !53 +// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.215a23369ed4d589(i16 %a, ptr %b), !dbg !53 +// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !54 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define i1 @"_CEqual:thunk:EqWith.83b9626e83cf3dcc.Core:enclosed"(i16 %self, ptr %other) #2 !dbg !54 { +// CHECK:STDOUT: define i1 @"_CEqual:thunk:EqWith.83b9626e83cf3dcc.Core:enclosed"(i16 %self, ptr %other) #2 !dbg !55 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !58 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !58 -// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !58 -// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !58 -// CHECK:STDOUT: %Equal.call = icmp eq i16 %self, %.8, !dbg !58 -// CHECK:STDOUT: ret i1 %Equal.call, !dbg !58 +// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !59 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !59 +// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !59 +// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !59 +// CHECK:STDOUT: %Equal.call = icmp eq i16 %self, %.8, !dbg !59 +// CHECK:STDOUT: ret i1 %Equal.call, !dbg !59 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define i1 @"_CNotEqual:thunk:EqWith.83b9626e83cf3dcc.Core:enclosed"(i16 %self, ptr %other) #2 !dbg !59 { +// CHECK:STDOUT: define i1 @"_CNotEqual:thunk:EqWith.83b9626e83cf3dcc.Core:enclosed"(i16 %self, ptr %other) #2 !dbg !60 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !63 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !63 -// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !63 -// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !63 -// CHECK:STDOUT: %NotEqual.call = icmp ne i16 %self, %.8, !dbg !63 -// CHECK:STDOUT: ret i1 %NotEqual.call, !dbg !63 +// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !64 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !64 +// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !64 +// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !64 +// CHECK:STDOUT: %NotEqual.call = icmp ne i16 %self, %.8, !dbg !64 +// CHECK:STDOUT: ret i1 %NotEqual.call, !dbg !64 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCallCompareGeneric2.Main(i32 %a, ptr %b) #0 !dbg !64 { +// CHECK:STDOUT: define i1 @_CCallCompareGeneric2.Main(i32 %a, ptr %b) #0 !dbg !65 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.a5489e454367d917(i32 %a, ptr %b), !dbg !68 -// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !69 +// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.a5489e454367d917(i32 %a, ptr %b), !dbg !69 +// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !70 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define i1 @"_CEqual:thunk:EqWith.e8fe48de943d9652.Core:enclosed"(i32 %self, ptr %other) #2 !dbg !70 { +// CHECK:STDOUT: define i1 @"_CEqual:thunk:EqWith.e8fe48de943d9652.Core:enclosed"(i32 %self, ptr %other) #2 !dbg !71 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %other), !dbg !74 -// CHECK:STDOUT: %Equal.call = icmp eq i32 %self, %__carbon_thunk.call, !dbg !74 -// CHECK:STDOUT: ret i1 %Equal.call, !dbg !74 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %other), !dbg !75 +// CHECK:STDOUT: %Equal.call = icmp eq i32 %self, %__carbon_thunk.call, !dbg !75 +// CHECK:STDOUT: ret i1 %Equal.call, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define i1 @"_CNotEqual:thunk:EqWith.e8fe48de943d9652.Core:enclosed"(i32 %self, ptr %other) #2 !dbg !75 { +// CHECK:STDOUT: define i1 @"_CNotEqual:thunk:EqWith.e8fe48de943d9652.Core:enclosed"(i32 %self, ptr %other) #2 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %other), !dbg !79 -// CHECK:STDOUT: %NotEqual.call = icmp ne i32 %self, %__carbon_thunk.call, !dbg !79 -// CHECK:STDOUT: ret i1 %NotEqual.call, !dbg !79 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %other), !dbg !80 +// CHECK:STDOUT: %NotEqual.call = icmp ne i32 %self, %__carbon_thunk.call, !dbg !80 +// CHECK:STDOUT: ret i1 %NotEqual.call, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCallCompareGeneric3.Main(i16 %a, ptr %b) #0 !dbg !80 { +// CHECK:STDOUT: define i1 @_CCallCompareGeneric3.Main(i16 %a, ptr %b) #0 !dbg !81 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.64b737572447efad(i16 %a, ptr %b), !dbg !84 -// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !85 +// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.64b737572447efad(i16 %a, ptr %b), !dbg !85 +// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !86 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define i1 @"_CEqual:thunk:EqWith.a294139a6615e163.Core:enclosed"(i16 %self, ptr %other) #2 !dbg !86 { +// CHECK:STDOUT: define i1 @"_CEqual:thunk:EqWith.a294139a6615e163.Core:enclosed"(i16 %self, ptr %other) #2 !dbg !87 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !90 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !90 -// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !90 -// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !90 -// CHECK:STDOUT: %Equal.call = icmp eq i16 %self, %.8, !dbg !90 -// CHECK:STDOUT: ret i1 %Equal.call, !dbg !90 +// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !91 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !91 +// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !91 +// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !91 +// CHECK:STDOUT: %Equal.call = icmp eq i16 %self, %.8, !dbg !91 +// CHECK:STDOUT: ret i1 %Equal.call, !dbg !91 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define i1 @"_CNotEqual:thunk:EqWith.a294139a6615e163.Core:enclosed"(i16 %self, ptr %other) #2 !dbg !91 { +// CHECK:STDOUT: define i1 @"_CNotEqual:thunk:EqWith.a294139a6615e163.Core:enclosed"(i16 %self, ptr %other) #2 !dbg !92 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !95 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !95 -// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !95 -// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !95 -// CHECK:STDOUT: %NotEqual.call = icmp ne i16 %self, %.8, !dbg !95 -// CHECK:STDOUT: ret i1 %NotEqual.call, !dbg !95 +// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !96 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !96 +// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !96 +// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !96 +// CHECK:STDOUT: %NotEqual.call = icmp ne i16 %self, %.8, !dbg !96 +// CHECK:STDOUT: ret i1 %NotEqual.call, !dbg !96 // CHECK:STDOUT: } // 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.215a23369ed4d589(i16 %x, ptr %y) #0 !dbg !96 { +// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.215a23369ed4d589(i16 %x, ptr %y) #0 !dbg !97 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.83b9626e83cf3dcc.Core:enclosed"(i16 %x, ptr %y), !dbg !100 -// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !101 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.83b9626e83cf3dcc.Core:enclosed"(i16 %x, ptr %y), !dbg !101 +// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !102 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.a5489e454367d917(i32 %x, ptr %y) #0 !dbg !102 { +// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.a5489e454367d917(i32 %x, ptr %y) #0 !dbg !103 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.e8fe48de943d9652.Core:enclosed"(i32 %x, ptr %y), !dbg !106 -// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !107 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.e8fe48de943d9652.Core:enclosed"(i32 %x, ptr %y), !dbg !107 +// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !108 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.64b737572447efad(i16 %x, ptr %y) #0 !dbg !108 { +// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.64b737572447efad(i16 %x, ptr %y) #0 !dbg !109 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.a294139a6615e163.Core:enclosed"(i16 %x, ptr %y), !dbg !112 -// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !113 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.a294139a6615e163.Core:enclosed"(i16 %x, ptr %y), !dbg !113 +// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !114 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef signext i16 @_ZNK13ConvertToEnumcvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1)) #4 @@ -698,111 +702,112 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Compare", linkageName: "_CCompare.Main", scope: null, file: !1, line: 17, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !15, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) -// CHECK:STDOUT: !16 = !{!17, !18} -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !11, type: !15) -// CHECK:STDOUT: !18 = !DILocalVariable(arg: 2, scope: !11, type: !14) -// CHECK:STDOUT: !19 = !DILocation(line: 18, column: 15, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 18, column: 10, scope: !11) -// CHECK:STDOUT: !21 = !DILocation(line: 18, column: 3, scope: !11) -// CHECK:STDOUT: !22 = !{!23, !23, i64 0} -// CHECK:STDOUT: !23 = !{!"p1 _ZTS13ConvertToEnum", !24, i64 0} -// CHECK:STDOUT: !24 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !25 = !{!24, !24, i64 0} -// CHECK:STDOUT: !26 = !{} -// CHECK:STDOUT: !27 = !{!28, !28, i64 0} -// CHECK:STDOUT: !28 = !{!"_ZTSN1C1EE", !9, i64 0} -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Compare2", linkageName: "_CCompare2.Main", scope: null, file: !1, line: 21, type: !30, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) -// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) -// CHECK:STDOUT: !31 = !{!14, !32, !14} -// CHECK:STDOUT: !32 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) -// CHECK:STDOUT: !33 = !{!34, !35} -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !29, type: !32) -// CHECK:STDOUT: !35 = !DILocalVariable(arg: 2, scope: !29, type: !14) -// CHECK:STDOUT: !36 = !DILocation(line: 22, column: 15, scope: !29) -// CHECK:STDOUT: !37 = !DILocation(line: 22, column: 10, scope: !29) -// CHECK:STDOUT: !38 = !DILocation(line: 22, column: 3, scope: !29) -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Compare3", linkageName: "_CCompare3.Main", scope: null, file: !1, line: 25, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !40) -// CHECK:STDOUT: !40 = !{!41, !42} -// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !39, type: !15) -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 2, scope: !39, type: !14) -// CHECK:STDOUT: !43 = !DILocation(line: 26, column: 15, scope: !39) -// CHECK:STDOUT: !44 = !DILocation(line: 26, column: 10, scope: !39) -// CHECK:STDOUT: !45 = !DILocation(line: 26, column: 3, scope: !39) -// CHECK:STDOUT: !46 = !{!47, !47, i64 0} -// CHECK:STDOUT: !47 = !{!"p1 _ZTS14ConvertToEnum2", !24, i64 0} -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "CallCompareGeneric", linkageName: "_CCallCompareGeneric.Main", scope: null, file: !1, line: 35, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !49) -// CHECK:STDOUT: !49 = !{!50, !51} -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !48, type: !15) -// CHECK:STDOUT: !51 = !DILocalVariable(arg: 2, scope: !48, type: !14) -// CHECK:STDOUT: !52 = !DILocation(line: 36, column: 10, scope: !48) -// CHECK:STDOUT: !53 = !DILocation(line: 36, column: 3, scope: !48) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.83b9626e83cf3dcc.Core:enclosed", scope: null, file: !1, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !55) -// CHECK:STDOUT: !55 = !{!56, !57} -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !54, type: !15) -// CHECK:STDOUT: !57 = !DILocalVariable(arg: 2, scope: !54, type: !14) -// CHECK:STDOUT: !58 = !DILocation(line: 0, scope: !54) -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.83b9626e83cf3dcc.Core:enclosed", scope: null, file: !1, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !60) -// CHECK:STDOUT: !60 = !{!61, !62} -// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !59, type: !15) -// CHECK:STDOUT: !62 = !DILocalVariable(arg: 2, scope: !59, type: !14) -// CHECK:STDOUT: !63 = !DILocation(line: 0, scope: !59) -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "CallCompareGeneric2", linkageName: "_CCallCompareGeneric2.Main", scope: null, file: !1, line: 39, type: !30, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !65) -// CHECK:STDOUT: !65 = !{!66, !67} -// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !64, type: !32) -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 2, scope: !64, type: !14) -// CHECK:STDOUT: !68 = !DILocation(line: 40, column: 10, scope: !64) -// CHECK:STDOUT: !69 = !DILocation(line: 40, column: 3, scope: !64) -// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.e8fe48de943d9652.Core:enclosed", scope: null, file: !1, type: !30, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !71) -// CHECK:STDOUT: !71 = !{!72, !73} -// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !70, type: !32) -// CHECK:STDOUT: !73 = !DILocalVariable(arg: 2, scope: !70, type: !14) -// CHECK:STDOUT: !74 = !DILocation(line: 0, scope: !70) -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.e8fe48de943d9652.Core:enclosed", scope: null, file: !1, type: !30, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !76) -// CHECK:STDOUT: !76 = !{!77, !78} -// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !75, type: !32) -// CHECK:STDOUT: !78 = !DILocalVariable(arg: 2, scope: !75, type: !14) -// CHECK:STDOUT: !79 = !DILocation(line: 0, scope: !75) -// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "CallCompareGeneric3", linkageName: "_CCallCompareGeneric3.Main", scope: null, file: !1, line: 43, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !81) -// CHECK:STDOUT: !81 = !{!82, !83} -// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !80, type: !15) -// CHECK:STDOUT: !83 = !DILocalVariable(arg: 2, scope: !80, type: !14) -// CHECK:STDOUT: !84 = !DILocation(line: 44, column: 10, scope: !80) -// CHECK:STDOUT: !85 = !DILocation(line: 44, column: 3, scope: !80) -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.a294139a6615e163.Core:enclosed", scope: null, file: !1, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !87) -// CHECK:STDOUT: !87 = !{!88, !89} -// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !86, type: !15) -// CHECK:STDOUT: !89 = !DILocalVariable(arg: 2, scope: !86, type: !14) -// CHECK:STDOUT: !90 = !DILocation(line: 0, scope: !86) -// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.a294139a6615e163.Core:enclosed", scope: null, file: !1, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !92) -// CHECK:STDOUT: !92 = !{!93, !94} -// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !91, type: !15) -// CHECK:STDOUT: !94 = !DILocalVariable(arg: 2, scope: !91, type: !14) -// CHECK:STDOUT: !95 = !DILocation(line: 0, scope: !91) -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.215a23369ed4d589", scope: null, file: !1, line: 29, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !97) -// CHECK:STDOUT: !97 = !{!98, !99} -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !96, type: !15) -// CHECK:STDOUT: !99 = !DILocalVariable(arg: 2, scope: !96, type: !14) -// CHECK:STDOUT: !100 = !DILocation(line: 30, column: 10, scope: !96) -// CHECK:STDOUT: !101 = !DILocation(line: 30, column: 3, scope: !96) -// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.a5489e454367d917", scope: null, file: !1, line: 29, type: !30, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !103) -// CHECK:STDOUT: !103 = !{!104, !105} -// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !102, type: !32) -// CHECK:STDOUT: !105 = !DILocalVariable(arg: 2, scope: !102, type: !14) -// CHECK:STDOUT: !106 = !DILocation(line: 30, column: 10, scope: !102) -// CHECK:STDOUT: !107 = !DILocation(line: 30, column: 3, scope: !102) -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.64b737572447efad", scope: null, file: !1, line: 29, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !109) -// CHECK:STDOUT: !109 = !{!110, !111} -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !108, type: !15) -// CHECK:STDOUT: !111 = !DILocalVariable(arg: 2, scope: !108, type: !14) -// CHECK:STDOUT: !112 = !DILocation(line: 30, column: 10, scope: !108) -// CHECK:STDOUT: !113 = !DILocation(line: 30, column: 3, scope: !108) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Compare", linkageName: "_CCompare.Main", scope: null, file: !1, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !17) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !16, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) +// CHECK:STDOUT: !17 = !{!18, !19} +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !12, type: !16) +// CHECK:STDOUT: !19 = !DILocalVariable(arg: 2, scope: !12, type: !15) +// CHECK:STDOUT: !20 = !DILocation(line: 18, column: 15, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 18, column: 10, scope: !12) +// CHECK:STDOUT: !22 = !DILocation(line: 18, column: 3, scope: !12) +// CHECK:STDOUT: !23 = !{!24, !24, i64 0} +// CHECK:STDOUT: !24 = !{!"p1 _ZTS13ConvertToEnum", !25, i64 0} +// CHECK:STDOUT: !25 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !26 = !{!25, !25, i64 0} +// CHECK:STDOUT: !27 = !{} +// CHECK:STDOUT: !28 = !{!29, !29, i64 0} +// CHECK:STDOUT: !29 = !{!"_ZTSN1C1EE", !10, i64 0} +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Compare2", linkageName: "_CCompare2.Main", scope: null, file: !1, line: 21, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34) +// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) +// CHECK:STDOUT: !32 = !{!15, !33, !15} +// CHECK:STDOUT: !33 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !34 = !{!35, !36} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !30, type: !33) +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 2, scope: !30, type: !15) +// CHECK:STDOUT: !37 = !DILocation(line: 22, column: 15, scope: !30) +// CHECK:STDOUT: !38 = !DILocation(line: 22, column: 10, scope: !30) +// CHECK:STDOUT: !39 = !DILocation(line: 22, column: 3, scope: !30) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Compare3", linkageName: "_CCompare3.Main", scope: null, file: !1, line: 25, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !41) +// CHECK:STDOUT: !41 = !{!42, !43} +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !16) +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 2, scope: !40, type: !15) +// CHECK:STDOUT: !44 = !DILocation(line: 26, column: 15, scope: !40) +// CHECK:STDOUT: !45 = !DILocation(line: 26, column: 10, scope: !40) +// CHECK:STDOUT: !46 = !DILocation(line: 26, column: 3, scope: !40) +// CHECK:STDOUT: !47 = !{!48, !48, i64 0} +// CHECK:STDOUT: !48 = !{!"p1 _ZTS14ConvertToEnum2", !25, i64 0} +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "CallCompareGeneric", linkageName: "_CCallCompareGeneric.Main", scope: null, file: !1, line: 35, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !50) +// CHECK:STDOUT: !50 = !{!51, !52} +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !16) +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 2, scope: !49, type: !15) +// CHECK:STDOUT: !53 = !DILocation(line: 36, column: 10, scope: !49) +// CHECK:STDOUT: !54 = !DILocation(line: 36, column: 3, scope: !49) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.83b9626e83cf3dcc.Core:enclosed", scope: null, file: !1, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !56) +// CHECK:STDOUT: !56 = !{!57, !58} +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !16) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 2, scope: !55, type: !15) +// CHECK:STDOUT: !59 = !DILocation(line: 0, scope: !55) +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.83b9626e83cf3dcc.Core:enclosed", scope: null, file: !1, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !61) +// CHECK:STDOUT: !61 = !{!62, !63} +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !60, type: !16) +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 2, scope: !60, type: !15) +// CHECK:STDOUT: !64 = !DILocation(line: 0, scope: !60) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "CallCompareGeneric2", linkageName: "_CCallCompareGeneric2.Main", scope: null, file: !1, line: 39, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !66) +// CHECK:STDOUT: !66 = !{!67, !68} +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !65, type: !33) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 2, scope: !65, type: !15) +// CHECK:STDOUT: !69 = !DILocation(line: 40, column: 10, scope: !65) +// CHECK:STDOUT: !70 = !DILocation(line: 40, column: 3, scope: !65) +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.e8fe48de943d9652.Core:enclosed", scope: null, file: !1, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !72) +// CHECK:STDOUT: !72 = !{!73, !74} +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !71, type: !33) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 2, scope: !71, type: !15) +// CHECK:STDOUT: !75 = !DILocation(line: 0, scope: !71) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.e8fe48de943d9652.Core:enclosed", scope: null, file: !1, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !77) +// CHECK:STDOUT: !77 = !{!78, !79} +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !76, type: !33) +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 2, scope: !76, type: !15) +// CHECK:STDOUT: !80 = !DILocation(line: 0, scope: !76) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "CallCompareGeneric3", linkageName: "_CCallCompareGeneric3.Main", scope: null, file: !1, line: 43, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !82) +// CHECK:STDOUT: !82 = !{!83, !84} +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !81, type: !16) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 2, scope: !81, type: !15) +// CHECK:STDOUT: !85 = !DILocation(line: 44, column: 10, scope: !81) +// CHECK:STDOUT: !86 = !DILocation(line: 44, column: 3, scope: !81) +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.a294139a6615e163.Core:enclosed", scope: null, file: !1, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !88) +// CHECK:STDOUT: !88 = !{!89, !90} +// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !87, type: !16) +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 2, scope: !87, type: !15) +// CHECK:STDOUT: !91 = !DILocation(line: 0, scope: !87) +// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.a294139a6615e163.Core:enclosed", scope: null, file: !1, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !93) +// CHECK:STDOUT: !93 = !{!94, !95} +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !92, type: !16) +// CHECK:STDOUT: !95 = !DILocalVariable(arg: 2, scope: !92, type: !15) +// CHECK:STDOUT: !96 = !DILocation(line: 0, scope: !92) +// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.215a23369ed4d589", scope: null, file: !1, line: 29, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !98) +// CHECK:STDOUT: !98 = !{!99, !100} +// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !97, type: !16) +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 2, scope: !97, type: !15) +// CHECK:STDOUT: !101 = !DILocation(line: 30, column: 10, scope: !97) +// CHECK:STDOUT: !102 = !DILocation(line: 30, column: 3, scope: !97) +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.a5489e454367d917", scope: null, file: !1, line: 29, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !104) +// CHECK:STDOUT: !104 = !{!105, !106} +// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !103, type: !33) +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 2, scope: !103, type: !15) +// CHECK:STDOUT: !107 = !DILocation(line: 30, column: 10, scope: !103) +// CHECK:STDOUT: !108 = !DILocation(line: 30, column: 3, scope: !103) +// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.64b737572447efad", scope: null, file: !1, line: 29, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !110) +// CHECK:STDOUT: !110 = !{!111, !112} +// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !109, type: !16) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 2, scope: !109, type: !15) +// CHECK:STDOUT: !113 = !DILocation(line: 30, column: 10, scope: !109) +// CHECK:STDOUT: !114 = !DILocation(line: 30, column: 3, scope: !109) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/extern_c.carbon b/toolchain/lower/testdata/interop/cpp/extern_c.carbon index b6696a1f82a5d..eb10173f73541 100644 --- a/toolchain/lower/testdata/interop/cpp/extern_c.carbon +++ b/toolchain/lower/testdata/interop/cpp/extern_c.carbon @@ -109,10 +109,10 @@ fn MyF() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @foo(), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: call void @foo(), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @foo() #1 @@ -131,15 +131,16 @@ fn MyF() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'extern_c_function_with_cpp_overload_set.carbon' @@ -148,11 +149,11 @@ fn MyF() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @foo(), !dbg !14 -// CHECK:STDOUT: call void @_Z3fooi(i32 5), !dbg !15 -// CHECK:STDOUT: ret void, !dbg !16 +// CHECK:STDOUT: call void @foo(), !dbg !15 +// CHECK:STDOUT: call void @_Z3fooi(i32 5), !dbg !16 +// CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @foo() #1 @@ -173,16 +174,17 @@ fn MyF() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 9, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 10, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 11, column: 3, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 9, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 10, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 11, column: 3, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 1, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_extern_c_variable.carbon' @@ -193,10 +195,10 @@ fn MyF() { // CHECK:STDOUT: @foo = external global i32, align 4 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CMyF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define i32 @_CMyF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7 = load i32, ptr @foo, align 4, !dbg !15 -// CHECK:STDOUT: ret i32 %.loc7, !dbg !16 +// CHECK:STDOUT: %.loc7 = load i32, ptr @foo, align 4, !dbg !16 +// CHECK:STDOUT: ret i32 %.loc7, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -212,16 +214,17 @@ fn MyF() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 3, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 3, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_extern_c_with_special_name.carbon' @@ -232,10 +235,10 @@ fn MyF() { // CHECK:STDOUT: %struct.X = type { i8 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main(ptr sret({}) %return, ptr %a, ptr %b) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CMyF.Main(ptr sret({}) %return, ptr %a, ptr %b) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Zpl1XS_.carbon_thunk.__(ptr %a, ptr %b, ptr %return), !dbg !18 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: call void @_Zpl1XS_.carbon_thunk.__(ptr %a, ptr %b, ptr %return), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -247,12 +250,12 @@ fn MyF() { // CHECK:STDOUT: %agg.tmp = alloca %struct.X, align 1 // CHECK:STDOUT: %agg.tmp2 = alloca %struct.X, align 1 // CHECK:STDOUT: %undef.agg.tmp = alloca %struct.X, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !20 -// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !20 -// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !20 -// CHECK:STDOUT: %4 = load ptr, ptr %.addr1, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !21 +// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !21 +// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !21 +// CHECK:STDOUT: %4 = load ptr, ptr %.addr1, align 8, !tbaa !21 // CHECK:STDOUT: call void @_Zpl1XS_() // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -274,22 +277,23 @@ fn MyF() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !14, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16, !17} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 2, scope: !11, type: !14) -// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !20 = !{!21, !21, i64 0} -// CHECK:STDOUT: !21 = !{!"p1 _ZTS1X", !22, i64 0} -// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !15, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17, !18} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 2, scope: !12, type: !15) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !21 = !{!22, !22, i64 0} +// CHECK:STDOUT: !22 = !{!"p1 _ZTS1X", !23, i64 0} +// CHECK:STDOUT: !23 = !{!"any pointer", !10, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_extern_c_with_asm_label.carbon' @@ -298,10 +302,10 @@ fn MyF() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @bar(), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: call void @bar(), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @bar() #1 @@ -320,13 +324,14 @@ fn MyF() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !12) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/export/function.carbon b/toolchain/lower/testdata/interop/cpp/function/export/function.carbon index fac14f0e39e70..14072028d955b 100644 --- a/toolchain/lower/testdata/interop/cpp/function/export/function.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/export/function.carbon @@ -161,7 +161,7 @@ fn H() { Cpp.G2(); } // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca i8, align 1 // CHECK:STDOUT: %storedv = zext i1 %0 to i8 -// CHECK:STDOUT: store i8 %storedv, ptr %.addr, align 1, !tbaa !11 +// CHECK:STDOUT: store i8 %storedv, ptr %.addr, align 1, !tbaa !12 // CHECK:STDOUT: call void @_CBoolArg__carbon_thunk.Other(ptr noundef nonnull align 1 dereferenceable(1) %.addr) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -170,7 +170,7 @@ fn H() { Cpp.G2(); } // CHECK:STDOUT: define internal void @_ZN6Carbon5OtherL6IntArgEi(i32 noundef %0) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca i32, align 4 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !14 // CHECK:STDOUT: call void @_CIntArg__carbon_thunk.Other(ptr noundef nonnull align 4 dereferenceable(4) %.addr) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -179,7 +179,7 @@ fn H() { Cpp.G2(); } // CHECK:STDOUT: define internal void @_ZN6Carbon5OtherL8FloatArgEf(float noundef %0) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca float, align 4 -// CHECK:STDOUT: store float %0, ptr %.addr, align 4, !tbaa !13 +// CHECK:STDOUT: store float %0, ptr %.addr, align 4, !tbaa !15 // CHECK:STDOUT: call void @_CFloatArg__carbon_thunk.Other(ptr noundef nonnull align 4 dereferenceable(4) %.addr) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -196,51 +196,51 @@ fn H() { Cpp.G2(); } // CHECK:STDOUT: declare void @_CNoArgs.Other() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CNoArgs__carbon_thunk.Other() #2 !dbg !15 { +// CHECK:STDOUT: define void @_CNoArgs__carbon_thunk.Other() #2 !dbg !17 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CNoArgs.Other(), !dbg !19 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: call void @_CNoArgs.Other(), !dbg !21 +// CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CBoolArg.Other(i1) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CBoolArg__carbon_thunk.Other(ptr %_) #2 !dbg !20 { +// CHECK:STDOUT: define void @_CBoolArg__carbon_thunk.Other(ptr %_) #2 !dbg !22 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.1 = load i8, ptr %_, align 1, !dbg !26 -// CHECK:STDOUT: %.11 = trunc i8 %.1 to i1, !dbg !26 -// CHECK:STDOUT: call void @_CBoolArg.Other(i1 %.11), !dbg !26 -// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: %.1 = load i8, ptr %_, align 1, !dbg !28 +// CHECK:STDOUT: %.11 = trunc i8 %.1 to i1, !dbg !28 +// CHECK:STDOUT: call void @_CBoolArg.Other(i1 %.11), !dbg !28 +// CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CIntArg.Other(i32) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CIntArg__carbon_thunk.Other(ptr %_) #2 !dbg !27 { +// CHECK:STDOUT: define void @_CIntArg__carbon_thunk.Other(ptr %_) #2 !dbg !29 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.1 = load i32, ptr %_, align 4, !dbg !33 -// CHECK:STDOUT: call void @_CIntArg.Other(i32 %.1), !dbg !33 -// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: %.1 = load i32, ptr %_, align 4, !dbg !35 +// CHECK:STDOUT: call void @_CIntArg.Other(i32 %.1), !dbg !35 +// CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CFloatArg.Other(float) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CFloatArg__carbon_thunk.Other(ptr %_) #2 !dbg !34 { +// CHECK:STDOUT: define void @_CFloatArg__carbon_thunk.Other(ptr %_) #2 !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.1 = load float, ptr %_, align 4, !dbg !37 -// CHECK:STDOUT: call void @_CFloatArg.Other(float %.1), !dbg !37 -// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: %.1 = load float, ptr %_, align 4, !dbg !39 +// CHECK:STDOUT: call void @_CFloatArg.Other(float %.1), !dbg !39 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare i32 @_CIntReturn.Other() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CIntReturn__carbon_thunk.Other(ptr %_) #2 !dbg !38 { +// CHECK:STDOUT: define void @_CIntReturn__carbon_thunk.Other(ptr %_) #2 !dbg !40 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %IntReturn.call = call i32 @_CIntReturn.Other(), !dbg !41 -// CHECK:STDOUT: store i32 %IntReturn.call, ptr %_, align 4, !dbg !41 -// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: %IntReturn.call = call i32 @_CIntReturn.Other(), !dbg !43 +// CHECK:STDOUT: store i32 %IntReturn.call, ptr %_, align 4, !dbg !43 +// CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -258,41 +258,43 @@ fn H() { Cpp.G2(); } // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"bool", !9, i64 0} -// CHECK:STDOUT: !13 = !{!14, !14, i64 0} -// CHECK:STDOUT: !14 = !{!"float", !9, i64 0} -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "NoArgs__carbon_thunk", linkageName: "_CNoArgs__carbon_thunk.Other", scope: null, file: !16, line: 2, type: !17, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !16 = !DIFile(filename: "other.carbon", directory: "") -// CHECK:STDOUT: !17 = !DISubroutineType(types: !18) -// CHECK:STDOUT: !18 = !{null} -// CHECK:STDOUT: !19 = !DILocation(line: 2, column: 1, scope: !15) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "BoolArg__carbon_thunk", linkageName: "_CBoolArg__carbon_thunk.Other", scope: null, file: !16, line: 3, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24) -// CHECK:STDOUT: !21 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !22 = !{null, !23} -// CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !24 = !{!25} -// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !20, type: !23) -// CHECK:STDOUT: !26 = !DILocation(line: 3, column: 1, scope: !20) -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "IntArg__carbon_thunk", linkageName: "_CIntArg__carbon_thunk.Other", scope: null, file: !16, line: 6, type: !28, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) -// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) -// CHECK:STDOUT: !29 = !{null, !30} -// CHECK:STDOUT: !30 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !31 = !{!32} -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !27, type: !30) -// CHECK:STDOUT: !33 = !DILocation(line: 6, column: 1, scope: !27) -// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "FloatArg__carbon_thunk", linkageName: "_CFloatArg__carbon_thunk.Other", scope: null, file: !16, line: 9, type: !21, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !35) -// CHECK:STDOUT: !35 = !{!36} -// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !23) -// CHECK:STDOUT: !37 = !DILocation(line: 9, column: 1, scope: !34) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "IntReturn__carbon_thunk", linkageName: "_CIntReturn__carbon_thunk.Other", scope: null, file: !16, line: 12, type: !28, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !39) -// CHECK:STDOUT: !39 = !{!40} -// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !30) -// CHECK:STDOUT: !41 = !DILocation(line: 12, column: 1, scope: !38) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"bool", !10, i64 0} +// CHECK:STDOUT: !14 = !{!9, !9, i64 0} +// CHECK:STDOUT: !15 = !{!16, !16, i64 0} +// CHECK:STDOUT: !16 = !{!"float", !10, i64 0} +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "NoArgs__carbon_thunk", linkageName: "_CNoArgs__carbon_thunk.Other", scope: null, file: !18, line: 2, type: !19, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !18 = !DIFile(filename: "other.carbon", directory: "") +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{null} +// CHECK:STDOUT: !21 = !DILocation(line: 2, column: 1, scope: !17) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "BoolArg__carbon_thunk", linkageName: "_CBoolArg__carbon_thunk.Other", scope: null, file: !18, line: 3, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) +// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !24 = !{null, !25} +// CHECK:STDOUT: !25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !22, type: !25) +// CHECK:STDOUT: !28 = !DILocation(line: 3, column: 1, scope: !22) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "IntArg__carbon_thunk", linkageName: "_CIntArg__carbon_thunk.Other", scope: null, file: !18, line: 6, type: !30, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) +// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) +// CHECK:STDOUT: !31 = !{null, !32} +// CHECK:STDOUT: !32 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !33 = !{!34} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !29, type: !32) +// CHECK:STDOUT: !35 = !DILocation(line: 6, column: 1, scope: !29) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "FloatArg__carbon_thunk", linkageName: "_CFloatArg__carbon_thunk.Other", scope: null, file: !18, line: 9, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !37) +// CHECK:STDOUT: !37 = !{!38} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !25) +// CHECK:STDOUT: !39 = !DILocation(line: 9, column: 1, scope: !36) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "IntReturn__carbon_thunk", linkageName: "_CIntReturn__carbon_thunk.Other", scope: null, file: !18, line: 12, type: !30, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !41) +// CHECK:STDOUT: !41 = !{!42} +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !32) +// CHECK:STDOUT: !43 = !DILocation(line: 12, column: 1, scope: !40) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'single_file.carbon' @@ -305,23 +307,23 @@ fn H() { Cpp.G2(); } // CHECK:STDOUT: $_Z2G1v = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !14 +// CHECK:STDOUT: ret void, !dbg !15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunk.Main() #0 !dbg !15 { +// CHECK:STDOUT: define void @_CF__carbon_thunk.Main() #0 !dbg !16 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main(), !dbg !16 -// CHECK:STDOUT: ret void, !dbg !16 +// CHECK:STDOUT: call void @_CF.Main(), !dbg !17 +// CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CH.Main() #0 !dbg !17 { +// CHECK:STDOUT: define void @_CH.Main() #0 !dbg !18 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z2G2v(), !dbg !18 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: call void @_Z2G2v(), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress uwtable @@ -360,17 +362,18 @@ fn H() { Cpp.G2(); } // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !15) -// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !1, line: 20, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !18 = !DILocation(line: 20, column: 10, scope: !17) -// CHECK:STDOUT: !19 = !DILocation(line: 20, column: 1, scope: !17) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !17 = !DILocation(line: 6, column: 1, scope: !16) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !1, line: 20, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !19 = !DILocation(line: 20, column: 10, scope: !18) +// CHECK:STDOUT: !20 = !DILocation(line: 20, column: 1, scope: !18) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/export/generic.carbon b/toolchain/lower/testdata/interop/cpp/function/export/generic.carbon index 436e7b617a4cc..fe118c235c31a 100644 --- a/toolchain/lower/testdata/interop/cpp/function/export/generic.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/export/generic.carbon @@ -142,7 +142,7 @@ fn Run() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1AD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !11 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.A.Main"(ptr noundef nonnull align 1 %this1) // CHECK:STDOUT: ret void @@ -160,7 +160,7 @@ fn Run() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon1BD2Ev(ptr noundef nonnull align 1 %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !14 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !15 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.B.Main"(ptr noundef nonnull align 1 %this1) // CHECK:STDOUT: ret void @@ -170,76 +170,76 @@ fn Run() { // CHECK:STDOUT: declare void @llvm.lifetime.end.p0(ptr captures(none)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_CDoit.A.Main:I.Main"(ptr %self) #4 !dbg !16 { +// CHECK:STDOUT: define void @"_CDoit.A.Main:I.Main"(ptr %self) #4 !dbg !17 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @"_CDoit.B.Main:I.Main"(ptr %self) #4 !dbg !23 { +// CHECK:STDOUT: define void @"_CDoit.B.Main:I.Main"(ptr %self) #4 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #5 !dbg !27 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #5 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self), !dbg !30 -// CHECK:STDOUT: ret void, !dbg !30 +// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self), !dbg !31 +// CHECK:STDOUT: ret void, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self) #4 !dbg !31 { +// CHECK:STDOUT: define weak_odr void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self) #4 !dbg !32 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.B.Main"(ptr %self) #5 !dbg !35 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.B.Main"(ptr %self) #5 !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.6c3865e9cbd9f6de:core.Destroy.Core"(ptr %self), !dbg !38 -// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: call void @"_COp.6c3865e9cbd9f6de:core.Destroy.Core"(ptr %self), !dbg !39 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6c3865e9cbd9f6de:core.Destroy.Core"(ptr %self) #4 !dbg !39 { +// CHECK:STDOUT: define weak_odr void @"_COp.6c3865e9cbd9f6de:core.Destroy.Core"(ptr %self) #4 !dbg !40 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunkinst70000035.Main(ptr %_) #4 !dbg !43 { +// CHECK:STDOUT: define void @_CF__carbon_thunkinst70000035.Main(ptr %_) #4 !dbg !44 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.3e1f7ed08cd9ee58(ptr %_), !dbg !46 -// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: call void @_CF.Main.3e1f7ed08cd9ee58(ptr %_), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF__carbon_thunkinst70000050.Main(ptr %_) #4 !dbg !47 { +// CHECK:STDOUT: define void @_CF__carbon_thunkinst70000050.Main(ptr %_) #4 !dbg !48 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main.bd1b6d59f703c190(ptr %_), !dbg !50 -// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: call void @_CF.Main.bd1b6d59f703c190(ptr %_), !dbg !51 +// CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @main() #4 !dbg !51 { +// CHECK:STDOUT: define i32 @main() #4 !dbg !52 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z1Gv(), !dbg !55 -// CHECK:STDOUT: ret i32 0, !dbg !56 +// CHECK:STDOUT: call void @_Z1Gv(), !dbg !56 +// CHECK:STDOUT: ret i32 0, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.3e1f7ed08cd9ee58(ptr %t) #4 !dbg !57 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.3e1f7ed08cd9ee58(ptr %t) #4 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_CDoit.A.Main:I.Main"(ptr %t), !dbg !60 -// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: call void @"_CDoit.A.Main:I.Main"(ptr %t), !dbg !61 +// CHECK:STDOUT: ret void, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF.Main.bd1b6d59f703c190(ptr %t) #4 !dbg !62 { +// CHECK:STDOUT: define linkonce_odr void @_CF.Main.bd1b6d59f703c190(ptr %t) #4 !dbg !63 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_CDoit.B.Main:I.Main"(ptr %t), !dbg !65 -// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: call void @"_CDoit.B.Main:I.Main"(ptr %t), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -266,64 +266,65 @@ fn Run() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 _ZTSN6Carbon1AE", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = !{!15, !15, i64 0} -// CHECK:STDOUT: !15 = !{!"p1 _ZTSN6Carbon1BE", !13, i64 0} -// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "Doit", linkageName: "_CDoit.A.Main:I.Main", scope: null, file: !1, line: 10, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !20) -// CHECK:STDOUT: !17 = !DISubroutineType(types: !18) -// CHECK:STDOUT: !18 = !{null, !19} -// CHECK:STDOUT: !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !20 = !{!21} -// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !16, type: !19) -// CHECK:STDOUT: !22 = !DILocation(line: 10, column: 5, scope: !16) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Doit", linkageName: "_CDoit.B.Main:I.Main", scope: null, file: !1, line: 15, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24) -// CHECK:STDOUT: !24 = !{!25} -// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !23, type: !19) -// CHECK:STDOUT: !26 = !DILocation(line: 15, column: 5, scope: !23) -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 8, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28) -// CHECK:STDOUT: !28 = !{!29} -// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !27, type: !19) -// CHECK:STDOUT: !30 = !DILocation(line: 8, column: 1, scope: !27) -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !1, line: 8, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !32) -// CHECK:STDOUT: !32 = !{!33} -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !19) -// CHECK:STDOUT: !34 = !DILocation(line: 8, column: 1, scope: !31) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.B.Main", scope: null, file: !1, line: 13, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !36) -// CHECK:STDOUT: !36 = !{!37} -// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !19) -// CHECK:STDOUT: !38 = !DILocation(line: 13, column: 1, scope: !35) -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6c3865e9cbd9f6de:core.Destroy.Core", scope: null, file: !1, line: 13, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !40) -// CHECK:STDOUT: !40 = !{!41} -// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !39, type: !19) -// CHECK:STDOUT: !42 = !DILocation(line: 13, column: 1, scope: !39) -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "F__carbon_thunkinst70000035", linkageName: "_CF__carbon_thunkinst70000035.Main", scope: null, file: !1, line: 19, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !44) -// CHECK:STDOUT: !44 = !{!45} -// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !43, type: !19) -// CHECK:STDOUT: !46 = !DILocation(line: 19, column: 1, scope: !43) -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "F__carbon_thunkinst70000050", linkageName: "_CF__carbon_thunkinst70000050.Main", scope: null, file: !1, line: 19, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !48) -// CHECK:STDOUT: !48 = !{!49} -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !47, type: !19) -// CHECK:STDOUT: !50 = !DILocation(line: 19, column: 1, scope: !47) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !1, line: 32, type: !52, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !52 = !DISubroutineType(types: !53) -// CHECK:STDOUT: !53 = !{!54} -// CHECK:STDOUT: !54 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !55 = !DILocation(line: 33, column: 3, scope: !51) -// CHECK:STDOUT: !56 = !DILocation(line: 32, column: 1, scope: !51) -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.3e1f7ed08cd9ee58", scope: null, file: !1, line: 19, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !58) -// CHECK:STDOUT: !58 = !{!59} -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !57, type: !19) -// CHECK:STDOUT: !60 = !DILocation(line: 20, column: 3, scope: !57) -// CHECK:STDOUT: !61 = !DILocation(line: 19, column: 1, scope: !57) -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.bd1b6d59f703c190", scope: null, file: !1, line: 19, type: !17, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !63) -// CHECK:STDOUT: !63 = !{!64} -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !62, type: !19) -// CHECK:STDOUT: !65 = !DILocation(line: 20, column: 3, scope: !62) -// CHECK:STDOUT: !66 = !DILocation(line: 19, column: 1, scope: !62) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 _ZTSN6Carbon1AE", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = !{!16, !16, i64 0} +// CHECK:STDOUT: !16 = !{!"p1 _ZTSN6Carbon1BE", !14, i64 0} +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Doit", linkageName: "_CDoit.A.Main:I.Main", scope: null, file: !1, line: 10, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) +// CHECK:STDOUT: !18 = !DISubroutineType(types: !19) +// CHECK:STDOUT: !19 = !{null, !20} +// CHECK:STDOUT: !20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !21 = !{!22} +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !17, type: !20) +// CHECK:STDOUT: !23 = !DILocation(line: 10, column: 5, scope: !17) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Doit", linkageName: "_CDoit.B.Main:I.Main", scope: null, file: !1, line: 15, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !25) +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !24, type: !20) +// CHECK:STDOUT: !27 = !DILocation(line: 15, column: 5, scope: !24) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 8, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !29) +// CHECK:STDOUT: !29 = !{!30} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !28, type: !20) +// CHECK:STDOUT: !31 = !DILocation(line: 8, column: 1, scope: !28) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !1, line: 8, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) +// CHECK:STDOUT: !33 = !{!34} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !20) +// CHECK:STDOUT: !35 = !DILocation(line: 8, column: 1, scope: !32) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.B.Main", scope: null, file: !1, line: 13, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !37) +// CHECK:STDOUT: !37 = !{!38} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !20) +// CHECK:STDOUT: !39 = !DILocation(line: 13, column: 1, scope: !36) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6c3865e9cbd9f6de:core.Destroy.Core", scope: null, file: !1, line: 13, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !41) +// CHECK:STDOUT: !41 = !{!42} +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !20) +// CHECK:STDOUT: !43 = !DILocation(line: 13, column: 1, scope: !40) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "F__carbon_thunkinst70000035", linkageName: "_CF__carbon_thunkinst70000035.Main", scope: null, file: !1, line: 19, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !45) +// CHECK:STDOUT: !45 = !{!46} +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !44, type: !20) +// CHECK:STDOUT: !47 = !DILocation(line: 19, column: 1, scope: !44) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "F__carbon_thunkinst70000050", linkageName: "_CF__carbon_thunkinst70000050.Main", scope: null, file: !1, line: 19, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !49) +// CHECK:STDOUT: !49 = !{!50} +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !48, type: !20) +// CHECK:STDOUT: !51 = !DILocation(line: 19, column: 1, scope: !48) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !1, line: 32, type: !53, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !53 = !DISubroutineType(types: !54) +// CHECK:STDOUT: !54 = !{!55} +// CHECK:STDOUT: !55 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !56 = !DILocation(line: 33, column: 3, scope: !52) +// CHECK:STDOUT: !57 = !DILocation(line: 32, column: 1, scope: !52) +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.3e1f7ed08cd9ee58", scope: null, file: !1, line: 19, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !59) +// CHECK:STDOUT: !59 = !{!60} +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !58, type: !20) +// CHECK:STDOUT: !61 = !DILocation(line: 20, column: 3, scope: !58) +// CHECK:STDOUT: !62 = !DILocation(line: 19, column: 1, scope: !58) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main.bd1b6d59f703c190", scope: null, file: !1, line: 19, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !64) +// CHECK:STDOUT: !64 = !{!65} +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !63, type: !20) +// CHECK:STDOUT: !66 = !DILocation(line: 20, column: 3, scope: !63) +// CHECK:STDOUT: !67 = !DILocation(line: 19, column: 1, scope: !63) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/import/cpp_run.carbon b/toolchain/lower/testdata/interop/cpp/function/import/cpp_run.carbon index e36a12a78ddd3..593fab819e592 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/cpp_run.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/cpp_run.carbon @@ -35,10 +35,10 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @main() #1 !dbg !11 { +// CHECK:STDOUT: define i32 @main() #1 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1N3RunEv(), !dbg !15 -// CHECK:STDOUT: ret i32 0, !dbg !16 +// CHECK:STDOUT: call void @_ZN1N3RunEv(), !dbg !16 +// CHECK:STDOUT: ret i32 0, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -55,14 +55,15 @@ fn Run() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !1, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !1, line: 8, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 8, column: 1, scope: !12) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon b/toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon index 80870b0154e98..93edb8ad2317d 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon @@ -139,10 +139,10 @@ fn MyF() -> i32 { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z3foov(), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: call void @_Z3foov(), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z3foov() #1 @@ -161,15 +161,16 @@ fn MyF() -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_inline_function_decl.carbon' @@ -180,10 +181,10 @@ fn MyF() -> i32 { // CHECK:STDOUT: $_Z3foov = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z3foov(), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: call void @_Z3foov(), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable @@ -206,15 +207,16 @@ fn MyF() -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_inline_used_function_decl.carbon' @@ -233,10 +235,10 @@ fn MyF() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #1 !dbg !11 { +// CHECK:STDOUT: define void @_CMyF.Main() #1 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z3foov(), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: call void @_Z3foov(), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -256,15 +258,16 @@ fn MyF() -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_multiple_inline_function_decls.carbon' @@ -279,12 +282,12 @@ fn MyF() -> i32 { // CHECK:STDOUT: $_Z4foo3v = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4foo1v(), !dbg !14 -// CHECK:STDOUT: call void @_Z4foo2v(), !dbg !15 -// CHECK:STDOUT: call void @_Z4foo3v(), !dbg !16 -// CHECK:STDOUT: ret void, !dbg !17 +// CHECK:STDOUT: call void @_Z4foo1v(), !dbg !15 +// CHECK:STDOUT: call void @_Z4foo2v(), !dbg !16 +// CHECK:STDOUT: call void @_Z4foo3v(), !dbg !17 +// CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable @@ -319,17 +322,18 @@ fn MyF() -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 3, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 6, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 3, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 6, column: 1, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_inline_recursive_function_decl.carbon' @@ -342,10 +346,10 @@ fn MyF() -> i32 { // CHECK:STDOUT: $_Z4foo1v = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4foo2v(), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: call void @_Z4foo2v(), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress uwtable @@ -376,15 +380,16 @@ fn MyF() -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 8, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_with_default_args.carbon' @@ -393,22 +398,22 @@ fn MyF() -> i32 { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CMyF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define i32 @_CMyF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %value.var = alloca i32, align 4, !dbg !15 -// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk.(), !dbg !16 -// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk._(i32 3), !dbg !17 -// CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 3, i32 4), !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %value.var), !dbg !15 -// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc11 = call i32 @_Z17SimpleReturnValueii.carbon_thunk.(), !dbg !19 -// CHECK:STDOUT: store i32 %SimpleReturnValue__carbon_thunk.call.loc11, ptr %value.var, align 4, !dbg !15 -// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc12 = call i32 @_Z17SimpleReturnValueii.carbon_thunk._(i32 3), !dbg !20 -// CHECK:STDOUT: store i32 %SimpleReturnValue__carbon_thunk.call.loc12, ptr %value.var, align 4, !dbg !21 -// CHECK:STDOUT: %SimpleReturnValue.call = call i32 @_Z17SimpleReturnValueii(i32 3, i32 4), !dbg !22 -// CHECK:STDOUT: store i32 %SimpleReturnValue.call, ptr %value.var, align 4, !dbg !23 -// CHECK:STDOUT: %.loc14 = load i32, ptr %value.var, align 4, !dbg !24 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %value.var), !dbg !15 -// CHECK:STDOUT: ret i32 %.loc14, !dbg !25 +// CHECK:STDOUT: %value.var = alloca i32, align 4, !dbg !16 +// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk.(), !dbg !17 +// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk._(i32 3), !dbg !18 +// CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 3, i32 4), !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %value.var), !dbg !16 +// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc11 = call i32 @_Z17SimpleReturnValueii.carbon_thunk.(), !dbg !20 +// CHECK:STDOUT: store i32 %SimpleReturnValue__carbon_thunk.call.loc11, ptr %value.var, align 4, !dbg !16 +// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc12 = call i32 @_Z17SimpleReturnValueii.carbon_thunk._(i32 3), !dbg !21 +// CHECK:STDOUT: store i32 %SimpleReturnValue__carbon_thunk.call.loc12, ptr %value.var, align 4, !dbg !22 +// CHECK:STDOUT: %SimpleReturnValue.call = call i32 @_Z17SimpleReturnValueii(i32 3, i32 4), !dbg !23 +// CHECK:STDOUT: store i32 %SimpleReturnValue.call, ptr %value.var, align 4, !dbg !24 +// CHECK:STDOUT: %.loc14 = load i32, ptr %value.var, align 4, !dbg !25 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %value.var), !dbg !16 +// CHECK:STDOUT: ret i32 %.loc14, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -422,8 +427,8 @@ fn MyF() -> i32 { // CHECK:STDOUT: define internal void @_Z13NoReturnValueii.carbon_thunk._(i32 noundef %a) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.addr = alloca i32, align 4 -// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !7 -// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !27 +// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !27 // CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 noundef %0, i32 noundef 2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -441,8 +446,8 @@ fn MyF() -> i32 { // CHECK:STDOUT: define internal noundef i32 @_Z17SimpleReturnValueii.carbon_thunk._(i32 noundef %a) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.addr = alloca i32, align 4 -// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !7 -// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !27 +// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !27 // CHECK:STDOUT: %call = call noundef i32 @_Z17SimpleReturnValueii(i32 noundef %0, i32 noundef 2) // CHECK:STDOUT: ret i32 %call // CHECK:STDOUT: } @@ -450,9 +455,9 @@ fn MyF() -> i32 { // CHECK:STDOUT: declare noundef i32 @_Z17SimpleReturnValueii(i32 noundef, i32 noundef) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !26 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -478,29 +483,31 @@ fn MyF() -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DILocation(line: 11, column: 3, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 8, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 20, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 12, column: 11, scope: !11) -// CHECK:STDOUT: !21 = !DILocation(line: 12, column: 3, scope: !11) -// CHECK:STDOUT: !22 = !DILocation(line: 13, column: 11, scope: !11) -// CHECK:STDOUT: !23 = !DILocation(line: 13, column: 3, scope: !11) -// CHECK:STDOUT: !24 = !DILocation(line: 14, column: 10, scope: !11) -// CHECK:STDOUT: !25 = !DILocation(line: 14, column: 3, scope: !11) -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 11, type: !27, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !29) -// CHECK:STDOUT: !27 = !DISubroutineType(types: !28) -// CHECK:STDOUT: !28 = !{null, !14} -// CHECK:STDOUT: !29 = !{!30} -// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !26, type: !14) -// CHECK:STDOUT: !31 = !DILocation(line: 11, column: 3, scope: !26) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DILocation(line: 11, column: 3, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 8, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 11, column: 20, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 12, column: 11, scope: !12) +// CHECK:STDOUT: !22 = !DILocation(line: 12, column: 3, scope: !12) +// CHECK:STDOUT: !23 = !DILocation(line: 13, column: 11, scope: !12) +// CHECK:STDOUT: !24 = !DILocation(line: 13, column: 3, scope: !12) +// CHECK:STDOUT: !25 = !DILocation(line: 14, column: 10, scope: !12) +// CHECK:STDOUT: !26 = !DILocation(line: 14, column: 3, scope: !12) +// CHECK:STDOUT: !27 = !{!9, !9, i64 0} +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 11, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{null, !15} +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !15) +// CHECK:STDOUT: !33 = !DILocation(line: 11, column: 3, scope: !28) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/import/function_in_template.carbon b/toolchain/lower/testdata/interop/cpp/function/import/function_in_template.carbon index 96dfef02af156..f7c1b7521dcda 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/function_in_template.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/function_in_template.carbon @@ -39,17 +39,17 @@ fn F() { // CHECK:STDOUT: $_ZN1XIiE1fEi = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1XIiE1fEi(i32 42), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: call void @_ZN1XIiE1fEi(i32 42), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1XIiE1fEi(i32 noundef %t) #1 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %t.addr = alloca i32, align 4 -// CHECK:STDOUT: store i32 %t, ptr %t.addr, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %t, ptr %t.addr, align 4, !tbaa !17 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -67,13 +67,15 @@ fn F() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 8, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !17 = !{!9, !9, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon b/toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon index aed958e9110f1..80242a4cdb202 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon @@ -34,28 +34,28 @@ fn Call() -> i32 { // CHECK:STDOUT: define dso_local void @_Z1FPi(ptr noundef %p) #0 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %p.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %p, ptr %p.addr, align 8, !tbaa !11 -// CHECK:STDOUT: %0 = load ptr, ptr %p.addr, align 8, !tbaa !11 -// CHECK:STDOUT: store i32 1, ptr %0, align 4, !tbaa !7 +// CHECK:STDOUT: store ptr %p, ptr %p.addr, align 8, !tbaa !12 +// CHECK:STDOUT: %0 = load ptr, ptr %p.addr, align 8, !tbaa !12 +// CHECK:STDOUT: store i32 1, ptr %0, align 4, !tbaa !15 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CCall.Main() #1 !dbg !14 { +// CHECK:STDOUT: define i32 @_CCall.Main() #1 !dbg !16 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !18 -// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !18 -// CHECK:STDOUT: call void @_Z1FPi(ptr %n.var), !dbg !19 -// CHECK:STDOUT: %.loc24 = load i32, ptr %n.var, align 4, !dbg !20 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %n.var), !dbg !18 -// CHECK:STDOUT: ret i32 %.loc24, !dbg !21 +// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !20 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !20 +// CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !20 +// CHECK:STDOUT: call void @_Z1FPi(ptr %n.var), !dbg !21 +// CHECK:STDOUT: %.loc24 = load i32, ptr %n.var, align 4, !dbg !22 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %n.var), !dbg !20 +// CHECK:STDOUT: ret i32 %.loc24, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #1 !dbg !22 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #1 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -76,25 +76,27 @@ fn Call() -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !12, i64 0} -// CHECK:STDOUT: !12 = !{!"p1 int", !13, i64 0} -// CHECK:STDOUT: !13 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 21, type: !15, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) -// CHECK:STDOUT: !16 = !{!17} -// CHECK:STDOUT: !17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !18 = !DILocation(line: 22, column: 3, scope: !14) -// CHECK:STDOUT: !19 = !DILocation(line: 23, column: 3, scope: !14) -// CHECK:STDOUT: !20 = !DILocation(line: 24, column: 10, scope: !14) -// CHECK:STDOUT: !21 = !DILocation(line: 24, column: 3, scope: !14) -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 22, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !25) -// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) -// CHECK:STDOUT: !24 = !{null, !17} -// CHECK:STDOUT: !25 = !{!26} -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !22, type: !17) -// CHECK:STDOUT: !27 = !DILocation(line: 22, column: 3, scope: !22) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !13, i64 0} +// CHECK:STDOUT: !13 = !{!"p1 int", !14, i64 0} +// CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !15 = !{!9, !9, i64 0} +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 21, type: !17, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !17 = !DISubroutineType(types: !18) +// CHECK:STDOUT: !18 = !{!19} +// CHECK:STDOUT: !19 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !20 = !DILocation(line: 22, column: 3, scope: !16) +// CHECK:STDOUT: !21 = !DILocation(line: 23, column: 3, scope: !16) +// CHECK:STDOUT: !22 = !DILocation(line: 24, column: 10, scope: !16) +// CHECK:STDOUT: !23 = !DILocation(line: 24, column: 3, scope: !16) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 22, type: !25, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !27) +// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) +// CHECK:STDOUT: !26 = !{null, !19} +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !24, type: !19) +// CHECK:STDOUT: !29 = !DILocation(line: 22, column: 3, scope: !24) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon b/toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon index 63e41ea62535b..98146c142805d 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon @@ -122,23 +122,23 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_19.3.temp = alloca i8, align 1, !dbg !14 -// CHECK:STDOUT: %.loc7_22.3.temp = alloca i16, align 2, !dbg !15 -// CHECK:STDOUT: %.loc9_21.3.temp = alloca i8, align 1, !dbg !16 -// CHECK:STDOUT: %.loc9_24.3.temp = alloca i16, align 2, !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_19.3.temp), !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_22.3.temp), !dbg !15 -// CHECK:STDOUT: call void @_Z11pass_signedasil.carbon_thunk.____(ptr @int_1.f1e, ptr @int_2.5c2, i32 3, i64 4), !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.3.temp), !dbg !16 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_24.3.temp), !dbg !17 -// CHECK:STDOUT: call void @_Z13pass_unsignedhtjm.carbon_thunk.____(ptr @int_1.067, ptr @int_2.ec3, i32 3, i64 4), !dbg !19 -// CHECK:STDOUT: call void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr @int_2.ec3), !dbg !17 -// CHECK:STDOUT: call void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr @int_1.067), !dbg !16 -// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr @int_2.5c2), !dbg !15 -// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr @int_1.f1e), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !20 +// CHECK:STDOUT: %.loc7_19.3.temp = alloca i8, align 1, !dbg !15 +// CHECK:STDOUT: %.loc7_22.3.temp = alloca i16, align 2, !dbg !16 +// CHECK:STDOUT: %.loc9_21.3.temp = alloca i8, align 1, !dbg !17 +// CHECK:STDOUT: %.loc9_24.3.temp = alloca i16, align 2, !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_19.3.temp), !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_22.3.temp), !dbg !16 +// CHECK:STDOUT: call void @_Z11pass_signedasil.carbon_thunk.____(ptr @int_1.f1e, ptr @int_2.5c2, i32 3, i64 4), !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.3.temp), !dbg !17 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_24.3.temp), !dbg !18 +// CHECK:STDOUT: call void @_Z13pass_unsignedhtjm.carbon_thunk.____(ptr @int_1.067, ptr @int_2.ec3, i32 3, i64 4), !dbg !20 +// CHECK:STDOUT: call void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr @int_2.ec3), !dbg !18 +// CHECK:STDOUT: call void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr @int_1.067), !dbg !17 +// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr @int_2.5c2), !dbg !16 +// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr @int_1.f1e), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -148,16 +148,16 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: %.addr1 = alloca ptr, align 8 // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %.addr3 = alloca i64, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !21 -// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !24 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !7 -// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !26 -// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !21 -// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !28 -// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !24 -// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !29 -// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !7 -// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !26 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !22 +// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !25 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !27 +// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !28 +// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !22 +// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !30 +// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !25 +// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !31 +// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !27 +// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !28 // CHECK:STDOUT: call void @_Z11pass_signedasil(i8 noundef signext %5, i16 noundef signext %7, i32 noundef %8, i64 noundef %9) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -169,82 +169,82 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: %.addr1 = alloca ptr, align 8 // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %.addr3 = alloca i64, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !21 -// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !24 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !7 -// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !26 -// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !21 -// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !28 -// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !24 -// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !29 -// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !7 -// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !26 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !22 +// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !25 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !27 +// CHECK:STDOUT: store i64 %3, ptr %.addr3, align 8, !tbaa !28 +// CHECK:STDOUT: %4 = load ptr, ptr %.addr, align 8, !tbaa !22 +// CHECK:STDOUT: %5 = load i8, ptr %4, align 1, !tbaa !30 +// CHECK:STDOUT: %6 = load ptr, ptr %.addr1, align 8, !tbaa !25 +// CHECK:STDOUT: %7 = load i16, ptr %6, align 2, !tbaa !31 +// CHECK:STDOUT: %8 = load i32, ptr %.addr2, align 4, !tbaa !27 +// CHECK:STDOUT: %9 = load i64, ptr %.addr3, align 8, !tbaa !28 // CHECK:STDOUT: call void @_Z13pass_unsignedhtjm(i8 noundef zeroext %5, i16 noundef zeroext %7, i32 noundef %8, i64 noundef %9) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %self) #0 !dbg !31 { +// CHECK:STDOUT: define weak_odr void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %self) #0 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %self) #0 !dbg !38 { +// CHECK:STDOUT: define weak_odr void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %self) #0 !dbg !40 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %self) #0 !dbg !47 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: ret void, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: define weak_odr void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %self) #0 !dbg !54 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: ret void, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare i16 @_CMakeShort.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassShort.Main(i16 %a, ptr %b) #0 !dbg !59 { +// CHECK:STDOUT: define void @_CPassShort.Main(i16 %a, ptr %b) #0 !dbg !61 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_18.1.temp = alloca i16, align 2, !dbg !66 -// CHECK:STDOUT: %.loc18_18.3.temp = alloca i16, align 2, !dbg !67 -// CHECK:STDOUT: %.loc19_18.2.temp = alloca i16, align 2, !dbg !68 -// CHECK:STDOUT: %.loc20_28.3.temp = alloca i16, align 2, !dbg !69 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !66 -// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !66 -// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc17_18.1.temp), !dbg !70 -// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !67 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !67 -// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !67 -// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc18_18.3.temp), !dbg !71 -// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !68 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !68 -// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !68 -// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc19_18.2.temp), !dbg !72 -// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !69 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !69 -// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !69 -// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc20_28.3.temp), !dbg !73 -// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc20_28.3.temp), !dbg !69 -// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc19_18.2.temp), !dbg !68 -// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc18_18.3.temp), !dbg !67 -// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc17_18.1.temp), !dbg !66 -// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: %.loc17_18.1.temp = alloca i16, align 2, !dbg !68 +// CHECK:STDOUT: %.loc18_18.3.temp = alloca i16, align 2, !dbg !69 +// CHECK:STDOUT: %.loc19_18.2.temp = alloca i16, align 2, !dbg !70 +// CHECK:STDOUT: %.loc20_28.3.temp = alloca i16, align 2, !dbg !71 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_18.1.temp), !dbg !68 +// CHECK:STDOUT: store i16 %a, ptr %.loc17_18.1.temp, align 2, !dbg !68 +// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc17_18.1.temp), !dbg !72 +// CHECK:STDOUT: %.loc18_18.2 = load i16, ptr %b, align 2, !dbg !69 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_18.3.temp), !dbg !69 +// CHECK:STDOUT: store i16 %.loc18_18.2, ptr %.loc18_18.3.temp, align 2, !dbg !69 +// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc18_18.3.temp), !dbg !73 +// CHECK:STDOUT: %.loc19_18.1 = load i16, ptr @_Cc.Main, align 2, !dbg !70 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !70 +// CHECK:STDOUT: store i16 %.loc19_18.1, ptr %.loc19_18.2.temp, align 2, !dbg !70 +// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc19_18.2.temp), !dbg !74 +// CHECK:STDOUT: %MakeShort.call = call i16 @_CMakeShort.Main(), !dbg !71 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_28.3.temp), !dbg !71 +// CHECK:STDOUT: store i16 %MakeShort.call, ptr %.loc20_28.3.temp, align 2, !dbg !71 +// CHECK:STDOUT: call void @_Z10pass_shorts.carbon_thunk._(ptr %.loc20_28.3.temp), !dbg !75 +// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc20_28.3.temp), !dbg !71 +// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc19_18.2.temp), !dbg !70 +// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc18_18.3.temp), !dbg !69 +// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc17_18.1.temp), !dbg !68 +// CHECK:STDOUT: ret void, !dbg !76 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z10pass_shorts.carbon_thunk._(ptr noundef %0) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !24 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !24 -// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !29 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !25 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !25 +// CHECK:STDOUT: %2 = load i16, ptr %1, align 2, !tbaa !31 // CHECK:STDOUT: call void @_Z10pass_shorts(i16 noundef signext %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -253,10 +253,10 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #0 !dbg !75 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #0 !dbg !77 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: store i16 poison, ptr @_Cc.Main, align 2, !dbg !76 -// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: store i16 poison, ptr @_Cc.Main, align 2, !dbg !78 +// CHECK:STDOUT: ret void, !dbg !79 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z11pass_signedasil(i8 noundef signext, i16 noundef signext, i32 noundef, i64 noundef) #3 @@ -285,77 +285,79 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 19, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 22, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 21, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 24, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !21 = !{!22, !22, i64 0} -// CHECK:STDOUT: !22 = !{!"p1 omnipotent char", !23, i64 0} -// CHECK:STDOUT: !23 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !24 = !{!25, !25, i64 0} -// CHECK:STDOUT: !25 = !{!"p1 short", !23, i64 0} -// CHECK:STDOUT: !26 = !{!27, !27, i64 0} -// CHECK:STDOUT: !27 = !{!"long", !9, i64 0} -// CHECK:STDOUT: !28 = !{!9, !9, i64 0} -// CHECK:STDOUT: !29 = !{!30, !30, i64 0} -// CHECK:STDOUT: !30 = !{!"short", !9, i64 0} -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6fd0ed7da7a22bb4:core.Destroy.Core", scope: null, file: !1, line: 9, type: !32, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !35) -// CHECK:STDOUT: !32 = !DISubroutineType(types: !33) -// CHECK:STDOUT: !33 = !{null, !34} -// CHECK:STDOUT: !34 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_unsigned) -// CHECK:STDOUT: !35 = !{!36} -// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !31, type: !34) -// CHECK:STDOUT: !37 = !DILocation(line: 9, column: 24, scope: !31) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core", scope: null, file: !1, line: 9, type: !39, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !42) -// CHECK:STDOUT: !39 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !40 = !{null, !41} -// CHECK:STDOUT: !41 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_unsigned) -// CHECK:STDOUT: !42 = !{!43} -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !38, type: !41) -// CHECK:STDOUT: !44 = !DILocation(line: 9, column: 21, scope: !38) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eb6702152d47e49f:core.Destroy.Core", scope: null, file: !1, line: 7, type: !46, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !49) -// CHECK:STDOUT: !46 = !DISubroutineType(types: !47) -// CHECK:STDOUT: !47 = !{null, !48} -// CHECK:STDOUT: !48 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) -// CHECK:STDOUT: !49 = !{!50} -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !45, type: !48) -// CHECK:STDOUT: !51 = !DILocation(line: 7, column: 22, scope: !45) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.578b3934f85dbca6:core.Destroy.Core", scope: null, file: !1, line: 7, type: !53, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !56) -// CHECK:STDOUT: !53 = !DISubroutineType(types: !54) -// CHECK:STDOUT: !54 = !{null, !55} -// CHECK:STDOUT: !55 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed) -// CHECK:STDOUT: !56 = !{!57} -// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !52, type: !55) -// CHECK:STDOUT: !58 = !DILocation(line: 7, column: 19, scope: !52) -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "PassShort", linkageName: "_CPassShort.Main", scope: null, file: !1, line: 16, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !63) -// CHECK:STDOUT: !60 = !DISubroutineType(types: !61) -// CHECK:STDOUT: !61 = !{null, !48, !62} -// CHECK:STDOUT: !62 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !63 = !{!64, !65} -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !59, type: !48) -// CHECK:STDOUT: !65 = !DILocalVariable(arg: 2, scope: !59, type: !62) -// CHECK:STDOUT: !66 = !DILocation(line: 17, column: 18, scope: !59) -// CHECK:STDOUT: !67 = !DILocation(line: 18, column: 18, scope: !59) -// CHECK:STDOUT: !68 = !DILocation(line: 19, column: 18, scope: !59) -// CHECK:STDOUT: !69 = !DILocation(line: 20, column: 18, scope: !59) -// CHECK:STDOUT: !70 = !DILocation(line: 17, column: 3, scope: !59) -// CHECK:STDOUT: !71 = !DILocation(line: 18, column: 3, scope: !59) -// CHECK:STDOUT: !72 = !DILocation(line: 19, column: 3, scope: !59) -// CHECK:STDOUT: !73 = !DILocation(line: 20, column: 3, scope: !59) -// CHECK:STDOUT: !74 = !DILocation(line: 16, column: 1, scope: !59) -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !76 = !DILocation(line: 14, column: 1, scope: !75) -// CHECK:STDOUT: !77 = !DILocation(line: 0, scope: !75) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 19, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 22, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 21, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 9, column: 24, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !22 = !{!23, !23, i64 0} +// CHECK:STDOUT: !23 = !{!"p1 omnipotent char", !24, i64 0} +// CHECK:STDOUT: !24 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !25 = !{!26, !26, i64 0} +// CHECK:STDOUT: !26 = !{!"p1 short", !24, i64 0} +// CHECK:STDOUT: !27 = !{!9, !9, i64 0} +// CHECK:STDOUT: !28 = !{!29, !29, i64 0} +// CHECK:STDOUT: !29 = !{!"long", !10, i64 0} +// CHECK:STDOUT: !30 = !{!10, !10, i64 0} +// CHECK:STDOUT: !31 = !{!32, !32, i64 0} +// CHECK:STDOUT: !32 = !{!"short", !10, i64 0} +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6fd0ed7da7a22bb4:core.Destroy.Core", scope: null, file: !1, line: 9, type: !34, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !37) +// CHECK:STDOUT: !34 = !DISubroutineType(types: !35) +// CHECK:STDOUT: !35 = !{null, !36} +// CHECK:STDOUT: !36 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !37 = !{!38} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !33, type: !36) +// CHECK:STDOUT: !39 = !DILocation(line: 9, column: 24, scope: !33) +// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core", scope: null, file: !1, line: 9, type: !41, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !44) +// CHECK:STDOUT: !41 = !DISubroutineType(types: !42) +// CHECK:STDOUT: !42 = !{null, !43} +// CHECK:STDOUT: !43 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !44 = !{!45} +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !40, type: !43) +// CHECK:STDOUT: !46 = !DILocation(line: 9, column: 21, scope: !40) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eb6702152d47e49f:core.Destroy.Core", scope: null, file: !1, line: 7, type: !48, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !51) +// CHECK:STDOUT: !48 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !49 = !{null, !50} +// CHECK:STDOUT: !50 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) +// CHECK:STDOUT: !51 = !{!52} +// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !47, type: !50) +// CHECK:STDOUT: !53 = !DILocation(line: 7, column: 22, scope: !47) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp.578b3934f85dbca6:core.Destroy.Core", scope: null, file: !1, line: 7, type: !55, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !58) +// CHECK:STDOUT: !55 = !DISubroutineType(types: !56) +// CHECK:STDOUT: !56 = !{null, !57} +// CHECK:STDOUT: !57 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed) +// CHECK:STDOUT: !58 = !{!59} +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !54, type: !57) +// CHECK:STDOUT: !60 = !DILocation(line: 7, column: 19, scope: !54) +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "PassShort", linkageName: "_CPassShort.Main", scope: null, file: !1, line: 16, type: !62, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !65) +// CHECK:STDOUT: !62 = !DISubroutineType(types: !63) +// CHECK:STDOUT: !63 = !{null, !50, !64} +// CHECK:STDOUT: !64 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !65 = !{!66, !67} +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !61, type: !50) +// CHECK:STDOUT: !67 = !DILocalVariable(arg: 2, scope: !61, type: !64) +// CHECK:STDOUT: !68 = !DILocation(line: 17, column: 18, scope: !61) +// CHECK:STDOUT: !69 = !DILocation(line: 18, column: 18, scope: !61) +// CHECK:STDOUT: !70 = !DILocation(line: 19, column: 18, scope: !61) +// CHECK:STDOUT: !71 = !DILocation(line: 20, column: 18, scope: !61) +// CHECK:STDOUT: !72 = !DILocation(line: 17, column: 3, scope: !61) +// CHECK:STDOUT: !73 = !DILocation(line: 18, column: 3, scope: !61) +// CHECK:STDOUT: !74 = !DILocation(line: 19, column: 3, scope: !61) +// CHECK:STDOUT: !75 = !DILocation(line: 20, column: 3, scope: !61) +// CHECK:STDOUT: !76 = !DILocation(line: 16, column: 1, scope: !61) +// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !78 = !DILocation(line: 14, column: 1, scope: !77) +// CHECK:STDOUT: !79 = !DILocation(line: 0, scope: !77) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_struct.carbon' @@ -366,35 +368,35 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: %struct.X = type { i32, i32, i32 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CTest.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CTest.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %x.var = alloca [12 x i8], align 4, !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !14 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr %x.var), !dbg !14 -// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 0, !dbg !15 -// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !15 -// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 4, !dbg !16 -// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !16 -// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 8, !dbg !17 -// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !17 -// CHECK:STDOUT: call void @_Z11pass_struct1X.carbon_thunk._(ptr %x.var), !dbg !18 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: %x.var = alloca [12 x i8], align 4, !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !15 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr %x.var), !dbg !15 +// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 0, !dbg !16 +// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !16 +// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 4, !dbg !17 +// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !17 +// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 8, !dbg !18 +// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !18 +// CHECK:STDOUT: call void @_Z11pass_struct1X.carbon_thunk._(ptr %x.var), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN1XC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !20 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !21 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !21 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr sret([12 x i8]) %return) #2 !dbg !23 { +// CHECK:STDOUT: define void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr sret([12 x i8]) %return) #2 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %return), !dbg !28 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %return), !dbg !29 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -403,9 +405,9 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.X, align 4 // CHECK:STDOUT: %agg.tmp.coerce = alloca { i64, i32 }, align 4 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !20 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 12, i1 false), !tbaa.struct !29 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !21 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 12, i1 false), !tbaa.struct !30 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp.coerce, ptr align 4 %agg.tmp, i64 12, i1 false) // CHECK:STDOUT: %2 = getelementptr inbounds nuw { i64, i32 }, ptr %agg.tmp.coerce, i32 0, i32 0 // CHECK:STDOUT: %3 = load i64, ptr %2, align 4 @@ -419,9 +421,9 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #4 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr sret([12 x i8]) %return) #0 !dbg !30 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr %return), !dbg !32 -// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr sret([12 x i8]) %return) #0 !dbg !32 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr %return), !dbg !34 +// CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z11pass_struct1X(i64, i32) #5 @@ -450,33 +452,35 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 3, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 10, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 11, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !20 = !{!21, !21, i64 0} -// CHECK:STDOUT: !21 = !{!"p1 _ZTS1X", !22, i64 0} -// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp", scope: null, file: !24, line: 2, type: !25, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !24 = !DIFile(filename: "./struct.h", directory: "") -// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !26 = !{!27} -// CHECK:STDOUT: !27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !28 = !DILocation(line: 2, column: 8, scope: !23) -// CHECK:STDOUT: !29 = !{i64 0, i64 4, !7, i64 4, i64 4, !7, i64 8, i64 4, !7} -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1", scope: null, file: !31, line: 9, type: !25, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !31 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") -// CHECK:STDOUT: !32 = !DILocation(line: 9, column: 28, scope: !30) -// CHECK:STDOUT: !33 = !DILocation(line: 9, column: 21, scope: !30) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 3, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 10, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !21 = !{!22, !22, i64 0} +// CHECK:STDOUT: !22 = !{!"p1 _ZTS1X", !23, i64 0} +// CHECK:STDOUT: !23 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp", scope: null, file: !25, line: 2, type: !26, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !25 = !DIFile(filename: "./struct.h", directory: "") +// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !29 = !DILocation(line: 2, column: 8, scope: !24) +// CHECK:STDOUT: !30 = !{i64 0, i64 4, !31, i64 4, i64 4, !31, i64 8, i64 4, !31} +// CHECK:STDOUT: !31 = !{!9, !9, i64 0} +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1", scope: null, file: !33, line: 9, type: !26, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !33 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") +// CHECK:STDOUT: !34 = !DILocation(line: 9, column: 28, scope: !32) +// CHECK:STDOUT: !35 = !DILocation(line: 9, column: 21, scope: !32) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_class_with_nontrivial_copy.carbon' @@ -487,18 +491,18 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: %class.Y = type { i32, i32, i32 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassRefExpr.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CPassRefExpr.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %y.var = alloca [12 x i8], align 4, !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !14 -// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 0, !dbg !15 -// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !15 -// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 4, !dbg !16 -// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !16 -// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 8, !dbg !17 -// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !17 -// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y.var), !dbg !18 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: %y.var = alloca [12 x i8], align 4, !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !15 +// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 0, !dbg !16 +// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !16 +// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 4, !dbg !17 +// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !17 +// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 8, !dbg !18 +// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !18 +// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y.var), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -506,36 +510,36 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.Y, align 4 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !20 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !21 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !21 // CHECK:STDOUT: call void @_ZN1YC1ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %agg.tmp, ptr noundef nonnull align 4 dereferenceable(12) %1) -// CHECK:STDOUT: call void @_Z11pass_struct1Y(ptr noundef dead_on_return %agg.tmp) +// CHECK:STDOUT: call void @_Z11pass_struct1Y(ptr noundef align 4 dead_on_return %agg.tmp) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_CMake.Main(ptr sret([12 x i8])) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassInitExpr.Main() #0 !dbg !23 { +// CHECK:STDOUT: define void @_CPassInitExpr.Main() #0 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_24.1.temp = alloca [12 x i8], align 4, !dbg !24 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_24.1.temp), !dbg !24 -// CHECK:STDOUT: call void @_CMake.Main(ptr %.loc17_24.1.temp), !dbg !24 -// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %.loc17_24.1.temp), !dbg !25 -// CHECK:STDOUT: ret void, !dbg !26 +// CHECK:STDOUT: %.loc17_24.1.temp = alloca [12 x i8], align 4, !dbg !25 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_24.1.temp), !dbg !25 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.loc17_24.1.temp), !dbg !25 +// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %.loc17_24.1.temp), !dbg !26 +// CHECK:STDOUT: ret void, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassValueExpr.Main(ptr %y) #0 !dbg !27 { +// CHECK:STDOUT: define void @_CPassValueExpr.Main(ptr %y) #0 !dbg !28 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y), !dbg !33 -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y), !dbg !34 +// CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // 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)) #2 // CHECK:STDOUT: -// CHECK:STDOUT: declare void @_Z11pass_struct1Y(ptr noundef dead_on_return) #3 +// CHECK:STDOUT: declare void @_Z11pass_struct1Y(ptr noundef align 4 dead_on_return) #3 // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN1YC1ERKS_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3 // CHECK:STDOUT: @@ -558,32 +562,33 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "PassRefExpr", linkageName: "_CPassRefExpr.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 3, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 10, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 11, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !20 = !{!21, !21, i64 0} -// CHECK:STDOUT: !21 = !{!"p1 _ZTS1Y", !22, i64 0} -// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "PassInitExpr", linkageName: "_CPassInitExpr.Main", scope: null, file: !1, line: 16, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !24 = !DILocation(line: 17, column: 19, scope: !23) -// CHECK:STDOUT: !25 = !DILocation(line: 17, column: 3, scope: !23) -// CHECK:STDOUT: !26 = !DILocation(line: 16, column: 1, scope: !23) -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "PassValueExpr", linkageName: "_CPassValueExpr.Main", scope: null, file: !1, line: 20, type: !28, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) -// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) -// CHECK:STDOUT: !29 = !{null, !30} -// CHECK:STDOUT: !30 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !31 = !{!32} -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !27, type: !30) -// CHECK:STDOUT: !33 = !DILocation(line: 21, column: 3, scope: !27) -// CHECK:STDOUT: !34 = !DILocation(line: 20, column: 1, scope: !27) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "PassRefExpr", linkageName: "_CPassRefExpr.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 3, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 10, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !21 = !{!22, !22, i64 0} +// CHECK:STDOUT: !22 = !{!"p1 _ZTS1Y", !23, i64 0} +// CHECK:STDOUT: !23 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "PassInitExpr", linkageName: "_CPassInitExpr.Main", scope: null, file: !1, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !25 = !DILocation(line: 17, column: 19, scope: !24) +// CHECK:STDOUT: !26 = !DILocation(line: 17, column: 3, scope: !24) +// CHECK:STDOUT: !27 = !DILocation(line: 16, column: 1, scope: !24) +// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "PassValueExpr", linkageName: "_CPassValueExpr.Main", scope: null, file: !1, line: 20, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !32) +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{null, !31} +// CHECK:STDOUT: !31 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !28, type: !31) +// CHECK:STDOUT: !34 = !DILocation(line: 21, column: 3, scope: !28) +// CHECK:STDOUT: !35 = !DILocation(line: 20, column: 1, scope: !28) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/import/return.carbon b/toolchain/lower/testdata/interop/cpp/function/import/return.carbon index e2359424b21da..8b5a46b655b8a 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/return.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/return.carbon @@ -119,121 +119,121 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i8 @_CGetU8.Main() #0 !dbg !11 { +// CHECK:STDOUT: define i8 @_CGetU8.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_40.1.temp = alloca i8, align 1, !dbg !15 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc6_40.1.temp), !dbg !15 -// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %.loc6_40.1.temp), !dbg !15 -// CHECK:STDOUT: %0 = load i8, ptr %.loc6_40.1.temp, align 1, !dbg !16 -// CHECK:STDOUT: ret i8 %0, !dbg !16 +// CHECK:STDOUT: %.loc6_40.1.temp = alloca i8, align 1, !dbg !16 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc6_40.1.temp), !dbg !16 +// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %.loc6_40.1.temp), !dbg !16 +// CHECK:STDOUT: %0 = load i8, ptr %.loc6_40.1.temp, align 1, !dbg !17 +// CHECK:STDOUT: ret i8 %0, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z8ReturnU8v.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !18 // CHECK:STDOUT: %call = call noundef zeroext i8 @_Z8ReturnU8v() -// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !20 +// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !21 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i16 @_CGetU16.Main() #0 !dbg !21 { +// CHECK:STDOUT: define i16 @_CGetU16.Main() #0 !dbg !22 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_43.1.temp = alloca i16, align 2, !dbg !25 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_43.1.temp), !dbg !25 -// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %.loc7_43.1.temp), !dbg !25 -// CHECK:STDOUT: %0 = load i16, ptr %.loc7_43.1.temp, align 2, !dbg !26 -// CHECK:STDOUT: ret i16 %0, !dbg !26 +// CHECK:STDOUT: %.loc7_43.1.temp = alloca i16, align 2, !dbg !26 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_43.1.temp), !dbg !26 +// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %.loc7_43.1.temp), !dbg !26 +// CHECK:STDOUT: %0 = load i16, ptr %.loc7_43.1.temp, align 2, !dbg !27 +// CHECK:STDOUT: ret i16 %0, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z9ReturnU16v.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !27 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !27 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !28 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !28 // CHECK:STDOUT: %call = call noundef zeroext i16 @_Z9ReturnU16v() -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !29 +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !30 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CGetU32.Main() #0 !dbg !31 { +// CHECK:STDOUT: define i32 @_CGetU32.Main() #0 !dbg !32 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !35 -// CHECK:STDOUT: ret i32 %ReturnU32.call, !dbg !36 +// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !36 +// CHECK:STDOUT: ret i32 %ReturnU32.call, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef i32 @_Z9ReturnU32v() #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i64 @_CGetU64.Main() #0 !dbg !37 { +// CHECK:STDOUT: define i64 @_CGetU64.Main() #0 !dbg !38 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !41 -// CHECK:STDOUT: ret i64 %ReturnU64.call, !dbg !42 +// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !42 +// CHECK:STDOUT: ret i64 %ReturnU64.call, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef i64 @_Z9ReturnU64v() #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i8 @_CGetI8.Main() #0 !dbg !43 { +// CHECK:STDOUT: define i8 @_CGetI8.Main() #0 !dbg !44 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_40.1.temp = alloca i8, align 1, !dbg !47 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_40.1.temp), !dbg !47 -// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %.loc11_40.1.temp), !dbg !47 -// CHECK:STDOUT: %0 = load i8, ptr %.loc11_40.1.temp, align 1, !dbg !48 -// CHECK:STDOUT: ret i8 %0, !dbg !48 +// CHECK:STDOUT: %.loc11_40.1.temp = alloca i8, align 1, !dbg !48 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_40.1.temp), !dbg !48 +// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %.loc11_40.1.temp), !dbg !48 +// CHECK:STDOUT: %0 = load i8, ptr %.loc11_40.1.temp, align 1, !dbg !49 +// CHECK:STDOUT: ret i8 %0, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z8ReturnI8v.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !18 // CHECK:STDOUT: %call = call noundef signext i8 @_Z8ReturnI8v() -// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !20 +// CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !21 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i16 @_CGetI16.Main() #0 !dbg !49 { +// CHECK:STDOUT: define i16 @_CGetI16.Main() #0 !dbg !50 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc12_43.1.temp = alloca i16, align 2, !dbg !53 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_43.1.temp), !dbg !53 -// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %.loc12_43.1.temp), !dbg !53 -// CHECK:STDOUT: %0 = load i16, ptr %.loc12_43.1.temp, align 2, !dbg !54 -// CHECK:STDOUT: ret i16 %0, !dbg !54 +// CHECK:STDOUT: %.loc12_43.1.temp = alloca i16, align 2, !dbg !54 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_43.1.temp), !dbg !54 +// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %.loc12_43.1.temp), !dbg !54 +// CHECK:STDOUT: %0 = load i16, ptr %.loc12_43.1.temp, align 2, !dbg !55 +// CHECK:STDOUT: ret i16 %0, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z9ReturnI16v.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !27 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !27 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !28 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !28 // CHECK:STDOUT: %call = call noundef signext i16 @_Z9ReturnI16v() -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !29 +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !30 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CGetI32.Main() #0 !dbg !55 { +// CHECK:STDOUT: define i32 @_CGetI32.Main() #0 !dbg !56 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !59 -// CHECK:STDOUT: ret i32 %ReturnI32.call, !dbg !60 +// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !60 +// CHECK:STDOUT: ret i32 %ReturnI32.call, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef i32 @_Z9ReturnI32v() #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i64 @_CGetI64.Main() #0 !dbg !61 { +// CHECK:STDOUT: define i64 @_CGetI64.Main() #0 !dbg !62 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !65 -// CHECK:STDOUT: ret i64 %ReturnI64.call, !dbg !66 +// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !66 +// CHECK:STDOUT: ret i64 %ReturnI64.call, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef i64 @_Z9ReturnI64v() #2 @@ -241,133 +241,133 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: declare void @_CUse.Main(i8, i16, i32, i64, i8, i16, i32, i64) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CLets.Main() #0 !dbg !67 { +// CHECK:STDOUT: define void @_CLets.Main() #0 !dbg !68 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc19_32.1.temp = alloca i8, align 1, !dbg !70 -// CHECK:STDOUT: %.loc20_35.1.temp = alloca i16, align 2, !dbg !71 -// CHECK:STDOUT: %.loc24_32.1.temp = alloca i8, align 1, !dbg !72 -// CHECK:STDOUT: %.loc25_35.1.temp = alloca i16, align 2, !dbg !73 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_32.1.temp), !dbg !70 -// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %.loc19_32.1.temp), !dbg !70 -// CHECK:STDOUT: %.loc19_32.4 = load i8, ptr %.loc19_32.1.temp, align 1, !dbg !70 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_35.1.temp), !dbg !71 -// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %.loc20_35.1.temp), !dbg !71 -// CHECK:STDOUT: %.loc20_35.4 = load i16, ptr %.loc20_35.1.temp, align 2, !dbg !71 -// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !74 -// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !75 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_32.1.temp), !dbg !72 -// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %.loc24_32.1.temp), !dbg !72 -// CHECK:STDOUT: %.loc24_32.4 = load i8, ptr %.loc24_32.1.temp, align 1, !dbg !72 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_35.1.temp), !dbg !73 -// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %.loc25_35.1.temp), !dbg !73 -// CHECK:STDOUT: %.loc25_35.4 = load i16, ptr %.loc25_35.1.temp, align 2, !dbg !73 -// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !76 -// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !77 -// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc19_32.4, i16 %.loc20_35.4, i32 %ReturnU32.call, i64 %ReturnU64.call, i8 %.loc24_32.4, i16 %.loc25_35.4, i32 %ReturnI32.call, i64 %ReturnI64.call), !dbg !78 -// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc25_35.1.temp), !dbg !73 -// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %.loc24_32.1.temp), !dbg !72 -// CHECK:STDOUT: call void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %.loc20_35.1.temp), !dbg !71 -// CHECK:STDOUT: call void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %.loc19_32.1.temp), !dbg !70 -// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: %.loc19_32.1.temp = alloca i8, align 1, !dbg !71 +// CHECK:STDOUT: %.loc20_35.1.temp = alloca i16, align 2, !dbg !72 +// CHECK:STDOUT: %.loc24_32.1.temp = alloca i8, align 1, !dbg !73 +// CHECK:STDOUT: %.loc25_35.1.temp = alloca i16, align 2, !dbg !74 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_32.1.temp), !dbg !71 +// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %.loc19_32.1.temp), !dbg !71 +// CHECK:STDOUT: %.loc19_32.4 = load i8, ptr %.loc19_32.1.temp, align 1, !dbg !71 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_35.1.temp), !dbg !72 +// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %.loc20_35.1.temp), !dbg !72 +// CHECK:STDOUT: %.loc20_35.4 = load i16, ptr %.loc20_35.1.temp, align 2, !dbg !72 +// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !75 +// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !76 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_32.1.temp), !dbg !73 +// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %.loc24_32.1.temp), !dbg !73 +// CHECK:STDOUT: %.loc24_32.4 = load i8, ptr %.loc24_32.1.temp, align 1, !dbg !73 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_35.1.temp), !dbg !74 +// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %.loc25_35.1.temp), !dbg !74 +// CHECK:STDOUT: %.loc25_35.4 = load i16, ptr %.loc25_35.1.temp, align 2, !dbg !74 +// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !77 +// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !78 +// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc19_32.4, i16 %.loc20_35.4, i32 %ReturnU32.call, i64 %ReturnU64.call, i8 %.loc24_32.4, i16 %.loc25_35.4, i32 %ReturnI32.call, i64 %ReturnI64.call), !dbg !79 +// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %.loc25_35.1.temp), !dbg !74 +// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %.loc24_32.1.temp), !dbg !73 +// CHECK:STDOUT: call void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %.loc20_35.1.temp), !dbg !72 +// CHECK:STDOUT: call void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %.loc19_32.1.temp), !dbg !71 +// CHECK:STDOUT: ret void, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %self) #0 !dbg !80 { +// CHECK:STDOUT: define weak_odr void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %self) #0 !dbg !81 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: ret void, !dbg !86 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: define weak_odr void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %self) #0 !dbg !87 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !91 +// CHECK:STDOUT: ret void, !dbg !92 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %self) #0 !dbg !92 { +// CHECK:STDOUT: define weak_odr void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %self) #0 !dbg !93 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: ret void, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %self) #0 !dbg !98 { +// CHECK:STDOUT: define weak_odr void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %self) #0 !dbg !99 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: ret void, !dbg !104 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CVars.Main() #0 !dbg !104 { +// CHECK:STDOUT: define void @_CVars.Main() #0 !dbg !105 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %my_u8.var = alloca i8, align 1, !dbg !105 -// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !106 -// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !107 -// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !108 -// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !109 -// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !110 -// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !111 -// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !112 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !105 -// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %my_u8.var), !dbg !113 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !106 -// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %my_u16.var), !dbg !114 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !107 -// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !115 -// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !107 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !108 -// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !116 -// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 8, !dbg !108 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !109 -// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %my_i8.var), !dbg !117 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !110 -// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %my_i16.var), !dbg !118 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !111 -// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !119 -// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !111 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !112 -// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !120 -// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 8, !dbg !112 -// CHECK:STDOUT: %.loc43_7 = load i8, ptr %my_u8.var, align 1, !dbg !121 -// CHECK:STDOUT: %.loc43_14 = load i16, ptr %my_u16.var, align 2, !dbg !122 -// CHECK:STDOUT: %.loc43_22 = load i32, ptr %my_u32.var, align 4, !dbg !123 -// CHECK:STDOUT: %.loc43_30 = load i64, ptr %my_u64.var, align 8, !dbg !124 -// CHECK:STDOUT: %.loc43_38 = load i8, ptr %my_i8.var, align 1, !dbg !125 -// CHECK:STDOUT: %.loc43_45 = load i16, ptr %my_i16.var, align 2, !dbg !126 -// CHECK:STDOUT: %.loc43_53 = load i32, ptr %my_i32.var, align 4, !dbg !127 -// CHECK:STDOUT: %.loc43_61 = load i64, ptr %my_i64.var, align 8, !dbg !128 -// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc43_7, i16 %.loc43_14, i32 %.loc43_22, i64 %.loc43_30, i8 %.loc43_38, i16 %.loc43_45, i32 %.loc43_53, i64 %.loc43_61), !dbg !129 -// CHECK:STDOUT: call void @"_COp.fbec46972c1998a0:core.Destroy.Core"(ptr %my_i64.var), !dbg !112 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %my_i32.var), !dbg !111 -// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %my_i16.var), !dbg !110 -// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %my_i8.var), !dbg !109 -// CHECK:STDOUT: call void @"_COp.df57f49075d1fe6b:core.Destroy.Core"(ptr %my_u64.var), !dbg !108 -// CHECK:STDOUT: call void @"_COp.45ecfb19e8cc5ab3:core.Destroy.Core"(ptr %my_u32.var), !dbg !107 -// CHECK:STDOUT: call void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %my_u16.var), !dbg !106 -// CHECK:STDOUT: call void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %my_u8.var), !dbg !105 -// CHECK:STDOUT: ret void, !dbg !130 +// CHECK:STDOUT: %my_u8.var = alloca i8, align 1, !dbg !106 +// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !107 +// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !108 +// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !109 +// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !110 +// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !111 +// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !112 +// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !113 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !106 +// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk.(ptr %my_u8.var), !dbg !114 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !107 +// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk.(ptr %my_u16.var), !dbg !115 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !108 +// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !116 +// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !108 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !109 +// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !117 +// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 8, !dbg !109 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !110 +// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk.(ptr %my_i8.var), !dbg !118 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !111 +// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk.(ptr %my_i16.var), !dbg !119 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !112 +// CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !120 +// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !112 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !113 +// CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !121 +// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 8, !dbg !113 +// CHECK:STDOUT: %.loc43_7 = load i8, ptr %my_u8.var, align 1, !dbg !122 +// CHECK:STDOUT: %.loc43_14 = load i16, ptr %my_u16.var, align 2, !dbg !123 +// CHECK:STDOUT: %.loc43_22 = load i32, ptr %my_u32.var, align 4, !dbg !124 +// CHECK:STDOUT: %.loc43_30 = load i64, ptr %my_u64.var, align 8, !dbg !125 +// CHECK:STDOUT: %.loc43_38 = load i8, ptr %my_i8.var, align 1, !dbg !126 +// CHECK:STDOUT: %.loc43_45 = load i16, ptr %my_i16.var, align 2, !dbg !127 +// CHECK:STDOUT: %.loc43_53 = load i32, ptr %my_i32.var, align 4, !dbg !128 +// CHECK:STDOUT: %.loc43_61 = load i64, ptr %my_i64.var, align 8, !dbg !129 +// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc43_7, i16 %.loc43_14, i32 %.loc43_22, i64 %.loc43_30, i8 %.loc43_38, i16 %.loc43_45, i32 %.loc43_53, i64 %.loc43_61), !dbg !130 +// CHECK:STDOUT: call void @"_COp.fbec46972c1998a0:core.Destroy.Core"(ptr %my_i64.var), !dbg !113 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %my_i32.var), !dbg !112 +// CHECK:STDOUT: call void @"_COp.eb6702152d47e49f:core.Destroy.Core"(ptr %my_i16.var), !dbg !111 +// CHECK:STDOUT: call void @"_COp.578b3934f85dbca6:core.Destroy.Core"(ptr %my_i8.var), !dbg !110 +// CHECK:STDOUT: call void @"_COp.df57f49075d1fe6b:core.Destroy.Core"(ptr %my_u64.var), !dbg !109 +// CHECK:STDOUT: call void @"_COp.45ecfb19e8cc5ab3:core.Destroy.Core"(ptr %my_u32.var), !dbg !108 +// CHECK:STDOUT: call void @"_COp.6fd0ed7da7a22bb4:core.Destroy.Core"(ptr %my_u16.var), !dbg !107 +// CHECK:STDOUT: call void @"_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core"(ptr %my_u8.var), !dbg !106 +// CHECK:STDOUT: ret void, !dbg !131 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.fbec46972c1998a0:core.Destroy.Core"(ptr %self) #0 !dbg !131 { +// CHECK:STDOUT: define weak_odr void @"_COp.fbec46972c1998a0:core.Destroy.Core"(ptr %self) #0 !dbg !132 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !136 +// CHECK:STDOUT: ret void, !dbg !137 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !137 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !138 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !142 +// CHECK:STDOUT: ret void, !dbg !143 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.df57f49075d1fe6b:core.Destroy.Core"(ptr %self) #0 !dbg !143 { +// CHECK:STDOUT: define weak_odr void @"_COp.df57f49075d1fe6b:core.Destroy.Core"(ptr %self) #0 !dbg !144 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !148 +// CHECK:STDOUT: ret void, !dbg !149 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.45ecfb19e8cc5ab3:core.Destroy.Core"(ptr %self) #0 !dbg !149 { +// CHECK:STDOUT: define weak_odr void @"_COp.45ecfb19e8cc5ab3:core.Destroy.Core"(ptr %self) #0 !dbg !150 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !154 +// CHECK:STDOUT: ret void, !dbg !155 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -400,154 +400,155 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "GetU8", linkageName: "_CGetU8.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_unsigned) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 27, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 20, scope: !11) -// CHECK:STDOUT: !17 = !{!18, !18, i64 0} -// CHECK:STDOUT: !18 = !{!"p1 omnipotent char", !19, i64 0} -// CHECK:STDOUT: !19 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !20 = !{!9, !9, i64 0} -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "GetU16", linkageName: "_CGetU16.Main", scope: null, file: !1, line: 7, type: !22, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) -// CHECK:STDOUT: !23 = !{!24} -// CHECK:STDOUT: !24 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_unsigned) -// CHECK:STDOUT: !25 = !DILocation(line: 7, column: 29, scope: !21) -// CHECK:STDOUT: !26 = !DILocation(line: 7, column: 22, scope: !21) -// CHECK:STDOUT: !27 = !{!28, !28, i64 0} -// CHECK:STDOUT: !28 = !{!"p1 short", !19, i64 0} -// CHECK:STDOUT: !29 = !{!30, !30, i64 0} -// CHECK:STDOUT: !30 = !{!"short", !9, i64 0} -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "GetU32", linkageName: "_CGetU32.Main", scope: null, file: !1, line: 8, type: !32, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !32 = !DISubroutineType(types: !33) -// CHECK:STDOUT: !33 = !{!34} -// CHECK:STDOUT: !34 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) -// CHECK:STDOUT: !35 = !DILocation(line: 8, column: 29, scope: !31) -// CHECK:STDOUT: !36 = !DILocation(line: 8, column: 22, scope: !31) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "GetU64", linkageName: "_CGetU64.Main", scope: null, file: !1, line: 9, type: !38, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !38 = !DISubroutineType(types: !39) -// CHECK:STDOUT: !39 = !{!40} -// CHECK:STDOUT: !40 = !DIBasicType(name: "int", size: 64, encoding: DW_ATE_unsigned) -// CHECK:STDOUT: !41 = !DILocation(line: 9, column: 29, scope: !37) -// CHECK:STDOUT: !42 = !DILocation(line: 9, column: 22, scope: !37) -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "GetI8", linkageName: "_CGetI8.Main", scope: null, file: !1, line: 11, type: !44, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !44 = !DISubroutineType(types: !45) -// CHECK:STDOUT: !45 = !{!46} -// CHECK:STDOUT: !46 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed) -// CHECK:STDOUT: !47 = !DILocation(line: 11, column: 27, scope: !43) -// CHECK:STDOUT: !48 = !DILocation(line: 11, column: 20, scope: !43) -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "GetI16", linkageName: "_CGetI16.Main", scope: null, file: !1, line: 12, type: !50, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !50 = !DISubroutineType(types: !51) -// CHECK:STDOUT: !51 = !{!52} -// CHECK:STDOUT: !52 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) -// CHECK:STDOUT: !53 = !DILocation(line: 12, column: 29, scope: !49) -// CHECK:STDOUT: !54 = !DILocation(line: 12, column: 22, scope: !49) -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "GetI32", linkageName: "_CGetI32.Main", scope: null, file: !1, line: 13, type: !56, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !56 = !DISubroutineType(types: !57) -// CHECK:STDOUT: !57 = !{!58} -// CHECK:STDOUT: !58 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !59 = !DILocation(line: 13, column: 29, scope: !55) -// CHECK:STDOUT: !60 = !DILocation(line: 13, column: 22, scope: !55) -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "GetI64", linkageName: "_CGetI64.Main", scope: null, file: !1, line: 14, type: !62, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !62 = !DISubroutineType(types: !63) -// CHECK:STDOUT: !63 = !{!64} -// CHECK:STDOUT: !64 = !DIBasicType(name: "int", size: 64, encoding: DW_ATE_signed) -// CHECK:STDOUT: !65 = !DILocation(line: 14, column: 29, scope: !61) -// CHECK:STDOUT: !66 = !DILocation(line: 14, column: 22, scope: !61) -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Lets", linkageName: "_CLets.Main", scope: null, file: !1, line: 18, type: !68, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !68 = !DISubroutineType(types: !69) -// CHECK:STDOUT: !69 = !{null} -// CHECK:STDOUT: !70 = !DILocation(line: 19, column: 19, scope: !67) -// CHECK:STDOUT: !71 = !DILocation(line: 20, column: 21, scope: !67) -// CHECK:STDOUT: !72 = !DILocation(line: 24, column: 19, scope: !67) -// CHECK:STDOUT: !73 = !DILocation(line: 25, column: 21, scope: !67) -// CHECK:STDOUT: !74 = !DILocation(line: 21, column: 21, scope: !67) -// CHECK:STDOUT: !75 = !DILocation(line: 22, column: 21, scope: !67) -// CHECK:STDOUT: !76 = !DILocation(line: 26, column: 21, scope: !67) -// CHECK:STDOUT: !77 = !DILocation(line: 27, column: 21, scope: !67) -// CHECK:STDOUT: !78 = !DILocation(line: 29, column: 3, scope: !67) -// CHECK:STDOUT: !79 = !DILocation(line: 18, column: 1, scope: !67) -// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eb6702152d47e49f:core.Destroy.Core", scope: null, file: !1, line: 25, type: !81, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !83) -// CHECK:STDOUT: !81 = !DISubroutineType(types: !82) -// CHECK:STDOUT: !82 = !{null, !52} -// CHECK:STDOUT: !83 = !{!84} -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !80, type: !52) -// CHECK:STDOUT: !85 = !DILocation(line: 25, column: 21, scope: !80) -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Op", linkageName: "_COp.578b3934f85dbca6:core.Destroy.Core", scope: null, file: !1, line: 24, type: !87, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !89) -// CHECK:STDOUT: !87 = !DISubroutineType(types: !88) -// CHECK:STDOUT: !88 = !{null, !46} -// CHECK:STDOUT: !89 = !{!90} -// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !86, type: !46) -// CHECK:STDOUT: !91 = !DILocation(line: 24, column: 19, scope: !86) -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6fd0ed7da7a22bb4:core.Destroy.Core", scope: null, file: !1, line: 20, type: !93, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !95) -// CHECK:STDOUT: !93 = !DISubroutineType(types: !94) -// CHECK:STDOUT: !94 = !{null, !24} -// CHECK:STDOUT: !95 = !{!96} -// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !92, type: !24) -// CHECK:STDOUT: !97 = !DILocation(line: 20, column: 21, scope: !92) -// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core", scope: null, file: !1, line: 19, type: !99, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !101) -// CHECK:STDOUT: !99 = !DISubroutineType(types: !100) -// CHECK:STDOUT: !100 = !{null, !14} -// CHECK:STDOUT: !101 = !{!102} -// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !98, type: !14) -// CHECK:STDOUT: !103 = !DILocation(line: 19, column: 19, scope: !98) -// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Vars", linkageName: "_CVars.Main", scope: null, file: !1, line: 32, type: !68, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !105 = !DILocation(line: 33, column: 3, scope: !104) -// CHECK:STDOUT: !106 = !DILocation(line: 34, column: 3, scope: !104) -// CHECK:STDOUT: !107 = !DILocation(line: 35, column: 3, scope: !104) -// CHECK:STDOUT: !108 = !DILocation(line: 36, column: 3, scope: !104) -// CHECK:STDOUT: !109 = !DILocation(line: 38, column: 3, scope: !104) -// CHECK:STDOUT: !110 = !DILocation(line: 39, column: 3, scope: !104) -// CHECK:STDOUT: !111 = !DILocation(line: 40, column: 3, scope: !104) -// CHECK:STDOUT: !112 = !DILocation(line: 41, column: 3, scope: !104) -// CHECK:STDOUT: !113 = !DILocation(line: 33, column: 19, scope: !104) -// CHECK:STDOUT: !114 = !DILocation(line: 34, column: 21, scope: !104) -// CHECK:STDOUT: !115 = !DILocation(line: 35, column: 21, scope: !104) -// CHECK:STDOUT: !116 = !DILocation(line: 36, column: 21, scope: !104) -// CHECK:STDOUT: !117 = !DILocation(line: 38, column: 19, scope: !104) -// CHECK:STDOUT: !118 = !DILocation(line: 39, column: 21, scope: !104) -// CHECK:STDOUT: !119 = !DILocation(line: 40, column: 21, scope: !104) -// CHECK:STDOUT: !120 = !DILocation(line: 41, column: 21, scope: !104) -// CHECK:STDOUT: !121 = !DILocation(line: 43, column: 7, scope: !104) -// CHECK:STDOUT: !122 = !DILocation(line: 43, column: 14, scope: !104) -// CHECK:STDOUT: !123 = !DILocation(line: 43, column: 22, scope: !104) -// CHECK:STDOUT: !124 = !DILocation(line: 43, column: 30, scope: !104) -// CHECK:STDOUT: !125 = !DILocation(line: 43, column: 38, scope: !104) -// CHECK:STDOUT: !126 = !DILocation(line: 43, column: 45, scope: !104) -// CHECK:STDOUT: !127 = !DILocation(line: 43, column: 53, scope: !104) -// CHECK:STDOUT: !128 = !DILocation(line: 43, column: 61, scope: !104) -// CHECK:STDOUT: !129 = !DILocation(line: 43, column: 3, scope: !104) -// CHECK:STDOUT: !130 = !DILocation(line: 32, column: 1, scope: !104) -// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fbec46972c1998a0:core.Destroy.Core", scope: null, file: !1, line: 41, type: !132, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !134) -// CHECK:STDOUT: !132 = !DISubroutineType(types: !133) -// CHECK:STDOUT: !133 = !{null, !64} -// CHECK:STDOUT: !134 = !{!135} -// CHECK:STDOUT: !135 = !DILocalVariable(arg: 1, scope: !131, type: !64) -// CHECK:STDOUT: !136 = !DILocation(line: 41, column: 3, scope: !131) -// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 40, type: !138, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !140) -// CHECK:STDOUT: !138 = !DISubroutineType(types: !139) -// CHECK:STDOUT: !139 = !{null, !58} -// CHECK:STDOUT: !140 = !{!141} -// CHECK:STDOUT: !141 = !DILocalVariable(arg: 1, scope: !137, type: !58) -// CHECK:STDOUT: !142 = !DILocation(line: 40, column: 3, scope: !137) -// CHECK:STDOUT: !143 = distinct !DISubprogram(name: "Op", linkageName: "_COp.df57f49075d1fe6b:core.Destroy.Core", scope: null, file: !1, line: 36, type: !144, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !146) -// CHECK:STDOUT: !144 = !DISubroutineType(types: !145) -// CHECK:STDOUT: !145 = !{null, !40} -// CHECK:STDOUT: !146 = !{!147} -// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !143, type: !40) -// CHECK:STDOUT: !148 = !DILocation(line: 36, column: 3, scope: !143) -// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "Op", linkageName: "_COp.45ecfb19e8cc5ab3:core.Destroy.Core", scope: null, file: !1, line: 35, type: !150, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !152) -// CHECK:STDOUT: !150 = !DISubroutineType(types: !151) -// CHECK:STDOUT: !151 = !{null, !34} -// CHECK:STDOUT: !152 = !{!153} -// CHECK:STDOUT: !153 = !DILocalVariable(arg: 1, scope: !149, type: !34) -// CHECK:STDOUT: !154 = !DILocation(line: 35, column: 3, scope: !149) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "GetU8", linkageName: "_CGetU8.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 27, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 6, column: 20, scope: !12) +// CHECK:STDOUT: !18 = !{!19, !19, i64 0} +// CHECK:STDOUT: !19 = !{!"p1 omnipotent char", !20, i64 0} +// CHECK:STDOUT: !20 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !21 = !{!10, !10, i64 0} +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "GetU16", linkageName: "_CGetU16.Main", scope: null, file: !1, line: 7, type: !23, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) +// CHECK:STDOUT: !24 = !{!25} +// CHECK:STDOUT: !25 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !26 = !DILocation(line: 7, column: 29, scope: !22) +// CHECK:STDOUT: !27 = !DILocation(line: 7, column: 22, scope: !22) +// CHECK:STDOUT: !28 = !{!29, !29, i64 0} +// CHECK:STDOUT: !29 = !{!"p1 short", !20, i64 0} +// CHECK:STDOUT: !30 = !{!31, !31, i64 0} +// CHECK:STDOUT: !31 = !{!"short", !10, i64 0} +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "GetU32", linkageName: "_CGetU32.Main", scope: null, file: !1, line: 8, type: !33, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !33 = !DISubroutineType(types: !34) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !36 = !DILocation(line: 8, column: 29, scope: !32) +// CHECK:STDOUT: !37 = !DILocation(line: 8, column: 22, scope: !32) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "GetU64", linkageName: "_CGetU64.Main", scope: null, file: !1, line: 9, type: !39, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !39 = !DISubroutineType(types: !40) +// CHECK:STDOUT: !40 = !{!41} +// CHECK:STDOUT: !41 = !DIBasicType(name: "int", size: 64, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !42 = !DILocation(line: 9, column: 29, scope: !38) +// CHECK:STDOUT: !43 = !DILocation(line: 9, column: 22, scope: !38) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "GetI8", linkageName: "_CGetI8.Main", scope: null, file: !1, line: 11, type: !45, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !45 = !DISubroutineType(types: !46) +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed) +// CHECK:STDOUT: !48 = !DILocation(line: 11, column: 27, scope: !44) +// CHECK:STDOUT: !49 = !DILocation(line: 11, column: 20, scope: !44) +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "GetI16", linkageName: "_CGetI16.Main", scope: null, file: !1, line: 12, type: !51, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !51 = !DISubroutineType(types: !52) +// CHECK:STDOUT: !52 = !{!53} +// CHECK:STDOUT: !53 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) +// CHECK:STDOUT: !54 = !DILocation(line: 12, column: 29, scope: !50) +// CHECK:STDOUT: !55 = !DILocation(line: 12, column: 22, scope: !50) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "GetI32", linkageName: "_CGetI32.Main", scope: null, file: !1, line: 13, type: !57, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !57 = !DISubroutineType(types: !58) +// CHECK:STDOUT: !58 = !{!59} +// CHECK:STDOUT: !59 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !60 = !DILocation(line: 13, column: 29, scope: !56) +// CHECK:STDOUT: !61 = !DILocation(line: 13, column: 22, scope: !56) +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "GetI64", linkageName: "_CGetI64.Main", scope: null, file: !1, line: 14, type: !63, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !63 = !DISubroutineType(types: !64) +// CHECK:STDOUT: !64 = !{!65} +// CHECK:STDOUT: !65 = !DIBasicType(name: "int", size: 64, encoding: DW_ATE_signed) +// CHECK:STDOUT: !66 = !DILocation(line: 14, column: 29, scope: !62) +// CHECK:STDOUT: !67 = !DILocation(line: 14, column: 22, scope: !62) +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Lets", linkageName: "_CLets.Main", scope: null, file: !1, line: 18, type: !69, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !69 = !DISubroutineType(types: !70) +// CHECK:STDOUT: !70 = !{null} +// CHECK:STDOUT: !71 = !DILocation(line: 19, column: 19, scope: !68) +// CHECK:STDOUT: !72 = !DILocation(line: 20, column: 21, scope: !68) +// CHECK:STDOUT: !73 = !DILocation(line: 24, column: 19, scope: !68) +// CHECK:STDOUT: !74 = !DILocation(line: 25, column: 21, scope: !68) +// CHECK:STDOUT: !75 = !DILocation(line: 21, column: 21, scope: !68) +// CHECK:STDOUT: !76 = !DILocation(line: 22, column: 21, scope: !68) +// CHECK:STDOUT: !77 = !DILocation(line: 26, column: 21, scope: !68) +// CHECK:STDOUT: !78 = !DILocation(line: 27, column: 21, scope: !68) +// CHECK:STDOUT: !79 = !DILocation(line: 29, column: 3, scope: !68) +// CHECK:STDOUT: !80 = !DILocation(line: 18, column: 1, scope: !68) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Op", linkageName: "_COp.eb6702152d47e49f:core.Destroy.Core", scope: null, file: !1, line: 25, type: !82, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !84) +// CHECK:STDOUT: !82 = !DISubroutineType(types: !83) +// CHECK:STDOUT: !83 = !{null, !53} +// CHECK:STDOUT: !84 = !{!85} +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !81, type: !53) +// CHECK:STDOUT: !86 = !DILocation(line: 25, column: 21, scope: !81) +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "Op", linkageName: "_COp.578b3934f85dbca6:core.Destroy.Core", scope: null, file: !1, line: 24, type: !88, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !90) +// CHECK:STDOUT: !88 = !DISubroutineType(types: !89) +// CHECK:STDOUT: !89 = !{null, !47} +// CHECK:STDOUT: !90 = !{!91} +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !87, type: !47) +// CHECK:STDOUT: !92 = !DILocation(line: 24, column: 19, scope: !87) +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6fd0ed7da7a22bb4:core.Destroy.Core", scope: null, file: !1, line: 20, type: !94, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !96) +// CHECK:STDOUT: !94 = !DISubroutineType(types: !95) +// CHECK:STDOUT: !95 = !{null, !25} +// CHECK:STDOUT: !96 = !{!97} +// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !93, type: !25) +// CHECK:STDOUT: !98 = !DILocation(line: 20, column: 21, scope: !93) +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Op", linkageName: "_COp.c3b9dc9c7e0d5d3d:core.Destroy.Core", scope: null, file: !1, line: 19, type: !100, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !102) +// CHECK:STDOUT: !100 = !DISubroutineType(types: !101) +// CHECK:STDOUT: !101 = !{null, !15} +// CHECK:STDOUT: !102 = !{!103} +// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !99, type: !15) +// CHECK:STDOUT: !104 = !DILocation(line: 19, column: 19, scope: !99) +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Vars", linkageName: "_CVars.Main", scope: null, file: !1, line: 32, type: !69, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !106 = !DILocation(line: 33, column: 3, scope: !105) +// CHECK:STDOUT: !107 = !DILocation(line: 34, column: 3, scope: !105) +// CHECK:STDOUT: !108 = !DILocation(line: 35, column: 3, scope: !105) +// CHECK:STDOUT: !109 = !DILocation(line: 36, column: 3, scope: !105) +// CHECK:STDOUT: !110 = !DILocation(line: 38, column: 3, scope: !105) +// CHECK:STDOUT: !111 = !DILocation(line: 39, column: 3, scope: !105) +// CHECK:STDOUT: !112 = !DILocation(line: 40, column: 3, scope: !105) +// CHECK:STDOUT: !113 = !DILocation(line: 41, column: 3, scope: !105) +// CHECK:STDOUT: !114 = !DILocation(line: 33, column: 19, scope: !105) +// CHECK:STDOUT: !115 = !DILocation(line: 34, column: 21, scope: !105) +// CHECK:STDOUT: !116 = !DILocation(line: 35, column: 21, scope: !105) +// CHECK:STDOUT: !117 = !DILocation(line: 36, column: 21, scope: !105) +// CHECK:STDOUT: !118 = !DILocation(line: 38, column: 19, scope: !105) +// CHECK:STDOUT: !119 = !DILocation(line: 39, column: 21, scope: !105) +// CHECK:STDOUT: !120 = !DILocation(line: 40, column: 21, scope: !105) +// CHECK:STDOUT: !121 = !DILocation(line: 41, column: 21, scope: !105) +// CHECK:STDOUT: !122 = !DILocation(line: 43, column: 7, scope: !105) +// CHECK:STDOUT: !123 = !DILocation(line: 43, column: 14, scope: !105) +// CHECK:STDOUT: !124 = !DILocation(line: 43, column: 22, scope: !105) +// CHECK:STDOUT: !125 = !DILocation(line: 43, column: 30, scope: !105) +// CHECK:STDOUT: !126 = !DILocation(line: 43, column: 38, scope: !105) +// CHECK:STDOUT: !127 = !DILocation(line: 43, column: 45, scope: !105) +// CHECK:STDOUT: !128 = !DILocation(line: 43, column: 53, scope: !105) +// CHECK:STDOUT: !129 = !DILocation(line: 43, column: 61, scope: !105) +// CHECK:STDOUT: !130 = !DILocation(line: 43, column: 3, scope: !105) +// CHECK:STDOUT: !131 = !DILocation(line: 32, column: 1, scope: !105) +// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fbec46972c1998a0:core.Destroy.Core", scope: null, file: !1, line: 41, type: !133, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !135) +// CHECK:STDOUT: !133 = !DISubroutineType(types: !134) +// CHECK:STDOUT: !134 = !{null, !65} +// CHECK:STDOUT: !135 = !{!136} +// CHECK:STDOUT: !136 = !DILocalVariable(arg: 1, scope: !132, type: !65) +// CHECK:STDOUT: !137 = !DILocation(line: 41, column: 3, scope: !132) +// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 40, type: !139, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !141) +// CHECK:STDOUT: !139 = !DISubroutineType(types: !140) +// CHECK:STDOUT: !140 = !{null, !59} +// CHECK:STDOUT: !141 = !{!142} +// CHECK:STDOUT: !142 = !DILocalVariable(arg: 1, scope: !138, type: !59) +// CHECK:STDOUT: !143 = !DILocation(line: 40, column: 3, scope: !138) +// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "Op", linkageName: "_COp.df57f49075d1fe6b:core.Destroy.Core", scope: null, file: !1, line: 36, type: !145, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !147) +// CHECK:STDOUT: !145 = !DISubroutineType(types: !146) +// CHECK:STDOUT: !146 = !{null, !41} +// CHECK:STDOUT: !147 = !{!148} +// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !144, type: !41) +// CHECK:STDOUT: !149 = !DILocation(line: 36, column: 3, scope: !144) +// CHECK:STDOUT: !150 = distinct !DISubprogram(name: "Op", linkageName: "_COp.45ecfb19e8cc5ab3:core.Destroy.Core", scope: null, file: !1, line: 35, type: !151, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !153) +// CHECK:STDOUT: !151 = !DISubroutineType(types: !152) +// CHECK:STDOUT: !152 = !{null, !35} +// CHECK:STDOUT: !153 = !{!154} +// CHECK:STDOUT: !154 = !DILocalVariable(arg: 1, scope: !150, type: !35) +// CHECK:STDOUT: !155 = !DILocation(line: 35, column: 3, scope: !150) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_class.carbon' @@ -558,43 +559,43 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %struct.X = type { ptr, ptr } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CGetX.Main(ptr sret([16 x i8]) %return) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CGetX.Main(ptr sret([16 x i8]) %return) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %return), !dbg !15 -// CHECK:STDOUT: ret void, !dbg !16 +// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %return), !dbg !16 +// CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z4Makev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !17 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !18 // CHECK:STDOUT: call void @_Z4Makev(ptr dead_on_unwind writable sret(%struct.X) align 8 %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CLet.Main() #0 !dbg !20 { +// CHECK:STDOUT: define void @_CLet.Main() #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_27.1.temp = alloca [16 x i8], align 8, !dbg !23 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_27.1.temp), !dbg !23 -// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %.loc9_27.1.temp), !dbg !23 -// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %.loc9_27.1.temp), !dbg !23 -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: %.loc9_27.1.temp = alloca [16 x i8], align 8, !dbg !24 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_27.1.temp), !dbg !24 +// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %.loc9_27.1.temp), !dbg !24 +// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %.loc9_27.1.temp), !dbg !24 +// CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: declare void @_ZN1XD1Ev(ptr noundef nonnull align 8 dead_on_return(16) dereferenceable(16)) unnamed_addr #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CVar.Main() #0 !dbg !25 { +// CHECK:STDOUT: define void @_CVar.Main() #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !26 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !26 -// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %_.var), !dbg !27 -// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %_.var), !dbg !26 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !27 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !27 +// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %_.var), !dbg !28 +// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %_.var), !dbg !27 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -622,28 +623,29 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "GetX", linkageName: "_CGetX.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 29, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 22, scope: !11) -// CHECK:STDOUT: !17 = !{!18, !18, i64 0} -// CHECK:STDOUT: !18 = !{!"p1 _ZTS1X", !19, i64 0} -// CHECK:STDOUT: !19 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Let", linkageName: "_CLet.Main", scope: null, file: !1, line: 8, type: !21, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !21 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !22 = !{null} -// CHECK:STDOUT: !23 = !DILocation(line: 9, column: 18, scope: !20) -// CHECK:STDOUT: !24 = !DILocation(line: 8, column: 1, scope: !20) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Var", linkageName: "_CVar.Main", scope: null, file: !1, line: 12, type: !21, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !26 = !DILocation(line: 13, column: 3, scope: !25) -// CHECK:STDOUT: !27 = !DILocation(line: 13, column: 18, scope: !25) -// CHECK:STDOUT: !28 = !DILocation(line: 12, column: 1, scope: !25) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "GetX", linkageName: "_CGetX.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 29, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 6, column: 22, scope: !12) +// CHECK:STDOUT: !18 = !{!19, !19, i64 0} +// CHECK:STDOUT: !19 = !{!"p1 _ZTS1X", !20, i64 0} +// CHECK:STDOUT: !20 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Let", linkageName: "_CLet.Main", scope: null, file: !1, line: 8, type: !22, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !22 = !DISubroutineType(types: !23) +// CHECK:STDOUT: !23 = !{null} +// CHECK:STDOUT: !24 = !DILocation(line: 9, column: 18, scope: !21) +// CHECK:STDOUT: !25 = !DILocation(line: 8, column: 1, scope: !21) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Var", linkageName: "_CVar.Main", scope: null, file: !1, line: 12, type: !22, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !27 = !DILocation(line: 13, column: 3, scope: !26) +// CHECK:STDOUT: !28 = !DILocation(line: 13, column: 18, scope: !26) +// CHECK:STDOUT: !29 = !DILocation(line: 12, column: 1, scope: !26) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'indirect_return_with_args.carbon' @@ -655,10 +657,10 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %class.C = type { i8 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %x) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %x) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk._(ptr %x, ptr %return), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk._(ptr %x, ptr %return), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -668,10 +670,10 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.D, align 1 // CHECK:STDOUT: %undef.agg.tmp = alloca %class.C, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !19 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !22 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !22 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !19 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !23 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !20 // CHECK:STDOUT: call void @_Z1f1D() // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -693,21 +695,22 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 10, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 11, column: 10, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 11, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !{!20, !20, i64 0} -// CHECK:STDOUT: !20 = !{!"p1 _ZTS1D", !21, i64 0} -// CHECK:STDOUT: !21 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !22 = !{!23, !23, i64 0} -// CHECK:STDOUT: !23 = !{!"p1 _ZTS1C", !21, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 10, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 11, column: 10, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !{!21, !21, i64 0} +// CHECK:STDOUT: !21 = !{!"p1 _ZTS1D", !22, i64 0} +// CHECK:STDOUT: !22 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !23 = !{!24, !24, i64 0} +// CHECK:STDOUT: !24 = !{!"p1 _ZTS1C", !22, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/globals.carbon b/toolchain/lower/testdata/interop/cpp/globals.carbon index 344b55bd5aab6..0aedb0a9e1138 100644 --- a/toolchain/lower/testdata/interop/cpp/globals.carbon +++ b/toolchain/lower/testdata/interop/cpp/globals.carbon @@ -165,9 +165,9 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: @global = dso_local global %class.C zeroinitializer, align 1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !14 +// CHECK:STDOUT: ret void, !dbg !15 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -183,14 +183,15 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 6, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_inline.carbon' @@ -272,10 +273,10 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: declare void @__cxa_guard_release(ptr) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallF.Main() #1 !dbg !11 { +// CHECK:STDOUT: define void @_CCallF.Main() #1 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1C1fEv(ptr @inline_global), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: call void @_ZN1C1fEv(ptr @inline_global), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN1C1fEv(ptr noundef nonnull align 1 dereferenceable(1)) #2 @@ -300,15 +301,16 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 6, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'todo_import_thread_local.carbon' @@ -331,7 +333,7 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: entry: // CHECK:STDOUT: %call = call noundef i32 @_Z4initv() // CHECK:STDOUT: %0 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @thread_local_global_with_init) -// CHECK:STDOUT: store i32 %call, ptr %0, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %call, ptr %0, align 4, !tbaa !12 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -341,17 +343,17 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CThreadLocalStore.Main() #3 !dbg !11 { +// CHECK:STDOUT: define void @_CThreadLocalStore.Main() #3 !dbg !13 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: store i32 42, ptr @thread_local_global, align 4, !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: store i32 42, ptr @thread_local_global, align 4, !dbg !16 +// CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CThreadLocalTriggerInit.Main() #3 !dbg !16 { +// CHECK:STDOUT: define i32 @_CThreadLocalTriggerInit.Main() #3 !dbg !18 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc14 = load i32, ptr @thread_local_global_with_init, align 4, !dbg !20 -// CHECK:STDOUT: ret i32 %.loc14, !dbg !21 +// CHECK:STDOUT: %.loc14 = load i32, ptr @thread_local_global_with_init, align 4, !dbg !22 +// CHECK:STDOUT: ret i32 %.loc14, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: uwtable @@ -359,7 +361,7 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: entry: // CHECK:STDOUT: %0 = load i8, ptr @__tls_guard, align 1 // CHECK:STDOUT: %guard.uninitialized = icmp eq i8 %0, 0 -// CHECK:STDOUT: br i1 %guard.uninitialized, label %init, label %exit, !prof !22 +// CHECK:STDOUT: br i1 %guard.uninitialized, label %init, label %exit, !prof !24 // CHECK:STDOUT: // CHECK:STDOUT: init: ; preds = %entry // CHECK:STDOUT: store i8 1, ptr @__tls_guard, align 1 @@ -405,22 +407,24 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "ThreadLocalStore", linkageName: "_CThreadLocalStore.Main", scope: null, file: !1, line: 9, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 10, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 9, column: 1, scope: !11) -// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "ThreadLocalTriggerInit", linkageName: "_CThreadLocalTriggerInit.Main", scope: null, file: !1, line: 13, type: !17, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !17 = !DISubroutineType(types: !18) -// CHECK:STDOUT: !18 = !{!19} -// CHECK:STDOUT: !19 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !20 = !DILocation(line: 14, column: 10, scope: !16) -// CHECK:STDOUT: !21 = !DILocation(line: 14, column: 3, scope: !16) -// CHECK:STDOUT: !22 = !{!"branch_weights", i32 1, i32 1023} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!9, !9, i64 0} +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "ThreadLocalStore", linkageName: "_CThreadLocalStore.Main", scope: null, file: !1, line: 9, type: !14, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !14 = !DISubroutineType(types: !15) +// CHECK:STDOUT: !15 = !{null} +// CHECK:STDOUT: !16 = !DILocation(line: 10, column: 3, scope: !13) +// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 1, scope: !13) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "ThreadLocalTriggerInit", linkageName: "_CThreadLocalTriggerInit.Main", scope: null, file: !1, line: 13, type: !19, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !22 = !DILocation(line: 14, column: 10, scope: !18) +// CHECK:STDOUT: !23 = !DILocation(line: 14, column: 3, scope: !18) +// CHECK:STDOUT: !24 = !{!"branch_weights", i32 1, i32 1023} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_static.carbon' @@ -433,10 +437,10 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: @_ZN1X1nE = linkonce_odr dso_local global i32 42, comdat, align 4 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CReadStatic.Main() #0 !dbg !11 { +// CHECK:STDOUT: define i32 @_CReadStatic.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7 = load i32, ptr @_ZN1X1nE, align 4, !dbg !15 -// CHECK:STDOUT: ret i32 %.loc7, !dbg !16 +// CHECK:STDOUT: %.loc7 = load i32, ptr @_ZN1X1nE, align 4, !dbg !16 +// CHECK:STDOUT: ret i32 %.loc7, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -452,16 +456,17 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "ReadStatic", linkageName: "_CReadStatic.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 3, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "ReadStatic", linkageName: "_CReadStatic.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 3, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_var_template.carbon' @@ -475,16 +480,16 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: @_Z4tmplI1YE = external global %struct.Y, align 1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CReadVarTemplate.Main() #0 !dbg !11 { +// CHECK:STDOUT: define i32 @_CReadVarTemplate.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7 = load i32, ptr @_Z4tmplIiE, align 4, !dbg !15 -// CHECK:STDOUT: ret i32 %.loc7, !dbg !16 +// CHECK:STDOUT: %.loc7 = load i32, ptr @_Z4tmplIiE, align 4, !dbg !16 +// CHECK:STDOUT: ret i32 %.loc7, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReadVarTemplateWithConstructor.Main() #0 !dbg !17 { +// CHECK:STDOUT: define ptr @_CReadVarTemplateWithConstructor.Main() #0 !dbg !18 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr @_Z4tmplI1YE, !dbg !21 +// CHECK:STDOUT: ret ptr @_Z4tmplI1YE, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -500,21 +505,22 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "ReadVarTemplate", linkageName: "_CReadVarTemplate.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "ReadVarTemplateWithConstructor", linkageName: "_CReadVarTemplateWithConstructor.Main", scope: null, file: !1, line: 10, type: !18, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !18 = !DISubroutineType(types: !19) -// CHECK:STDOUT: !19 = !{!20} -// CHECK:STDOUT: !20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !21 = !DILocation(line: 11, column: 3, scope: !17) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "ReadVarTemplate", linkageName: "_CReadVarTemplate.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "ReadVarTemplateWithConstructor", linkageName: "_CReadVarTemplateWithConstructor.Main", scope: null, file: !1, line: 10, type: !19, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !22 = !DILocation(line: 11, column: 3, scope: !18) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_static_template.carbon' @@ -528,16 +534,16 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: @_ZN1X11static_tmplI1YEE = external global %struct.Y, align 1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CReadStaticVarTemplate.Main() #0 !dbg !11 { +// CHECK:STDOUT: define i32 @_CReadStaticVarTemplate.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7 = load i32, ptr @_ZN1X11static_tmplIiEE, align 4, !dbg !15 -// CHECK:STDOUT: ret i32 %.loc7, !dbg !16 +// CHECK:STDOUT: %.loc7 = load i32, ptr @_ZN1X11static_tmplIiEE, align 4, !dbg !16 +// CHECK:STDOUT: ret i32 %.loc7, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReadStaticVarTemplateWithConstructor.Main() #0 !dbg !17 { +// CHECK:STDOUT: define ptr @_CReadStaticVarTemplateWithConstructor.Main() #0 !dbg !18 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr @_ZN1X11static_tmplI1YEE, !dbg !21 +// CHECK:STDOUT: ret ptr @_ZN1X11static_tmplI1YEE, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -553,19 +559,20 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "ReadStaticVarTemplate", linkageName: "_CReadStaticVarTemplate.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "ReadStaticVarTemplateWithConstructor", linkageName: "_CReadStaticVarTemplateWithConstructor.Main", scope: null, file: !1, line: 10, type: !18, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !18 = !DISubroutineType(types: !19) -// CHECK:STDOUT: !19 = !{!20} -// CHECK:STDOUT: !20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !21 = !DILocation(line: 11, column: 3, scope: !17) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "ReadStaticVarTemplate", linkageName: "_CReadStaticVarTemplate.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "ReadStaticVarTemplateWithConstructor", linkageName: "_CReadStaticVarTemplateWithConstructor.Main", scope: null, file: !1, line: 10, type: !19, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !22 = !DILocation(line: 11, column: 3, scope: !18) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/issue7142.carbon b/toolchain/lower/testdata/interop/cpp/issue7142.carbon index 1bbd2a4a76916..583a8341b835f 100644 --- a/toolchain/lower/testdata/interop/cpp/issue7142.carbon +++ b/toolchain/lower/testdata/interop/cpp/issue7142.carbon @@ -49,43 +49,43 @@ void f() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %call = call noundef ptr @_ZN6CarbonL3GetEv() // CHECK:STDOUT: %price = getelementptr inbounds nuw %"class.Carbon::A", ptr %call, i32 0, i32 0 -// CHECK:STDOUT: %0 = load i32, ptr %price, align 4, !tbaa !11 +// CHECK:STDOUT: %0 = load i32, ptr %price, align 4, !tbaa !12 // CHECK:STDOUT: ret i32 %0 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare ptr @_CGet.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CGet__carbon_thunk.Main(ptr %_) #1 !dbg !13 { +// CHECK:STDOUT: define void @_CGet__carbon_thunk.Main(ptr %_) #1 !dbg !14 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Get.call = call ptr @_CGet.Main(), !dbg !19 -// CHECK:STDOUT: store ptr %Get.call, ptr %_, align 8, !dbg !19 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: %Get.call = call ptr @_CGet.Main(), !dbg !20 +// CHECK:STDOUT: store ptr %Get.call, ptr %_, align 8, !dbg !20 +// CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #2 !dbg !20 { +// CHECK:STDOUT: define void @"_C__destroy_thunk:thunk.A.Main"(ptr %self) #2 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self), !dbg !23 -// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: call void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self), !dbg !24 +// CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #1 !dbg !24 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #1 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !30 +// CHECK:STDOUT: ret void, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.dd803598fd1f0f08:core.Destroy.Core"(ptr %self) #1 !dbg !31 { +// CHECK:STDOUT: define weak_odr void @"_COp.dd803598fd1f0f08:core.Destroy.Core"(ptr %self) #1 !dbg !32 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !34 +// CHECK:STDOUT: ret void, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self) #1 !dbg !35 { +// CHECK:STDOUT: define weak_odr void @"_COp.68011419f123494e:core.Destroy.Core"(ptr %self) #1 !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -113,36 +113,37 @@ void f() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = !{!12, !8, i64 0} -// CHECK:STDOUT: !12 = !{!"_ZTSN6Carbon1AE", !8, i64 0} -// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Get__carbon_thunk", linkageName: "_CGet__carbon_thunk.Main", scope: null, file: !1, line: 16, type: !14, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !17) -// CHECK:STDOUT: !14 = !DISubroutineType(types: !15) -// CHECK:STDOUT: !15 = !{null, !16} -// CHECK:STDOUT: !16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !17 = !{!18} -// CHECK:STDOUT: !18 = !DILocalVariable(arg: 1, scope: !13, type: !16) -// CHECK:STDOUT: !19 = !DILocation(line: 16, column: 1, scope: !13) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 15, type: !14, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) -// CHECK:STDOUT: !21 = !{!22} -// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !16) -// CHECK:STDOUT: !23 = !DILocation(line: 15, column: 1, scope: !20) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 15, type: !25, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28) -// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !26 = !{null, !27} -// CHECK:STDOUT: !27 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !28 = !{!29} -// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !24, type: !27) -// CHECK:STDOUT: !30 = !DILocation(line: 15, column: 1, scope: !24) -// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dd803598fd1f0f08:core.Destroy.Core", scope: null, file: !1, line: 15, type: !14, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !32) -// CHECK:STDOUT: !32 = !{!33} -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !16) -// CHECK:STDOUT: !34 = !DILocation(line: 15, column: 1, scope: !31) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !1, line: 15, type: !14, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !36) -// CHECK:STDOUT: !36 = !{!37} -// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !16) -// CHECK:STDOUT: !38 = !DILocation(line: 15, column: 1, scope: !35) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!13, !9, i64 0} +// CHECK:STDOUT: !13 = !{!"_ZTSN6Carbon1AE", !9, i64 0} +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "Get__carbon_thunk", linkageName: "_CGet__carbon_thunk.Main", scope: null, file: !1, line: 16, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !18) +// CHECK:STDOUT: !15 = !DISubroutineType(types: !16) +// CHECK:STDOUT: !16 = !{null, !17} +// CHECK:STDOUT: !17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !18 = !{!19} +// CHECK:STDOUT: !19 = !DILocalVariable(arg: 1, scope: !14, type: !17) +// CHECK:STDOUT: !20 = !DILocation(line: 16, column: 1, scope: !14) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.A.Main", scope: null, file: !1, line: 15, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !21, type: !17) +// CHECK:STDOUT: !24 = !DILocation(line: 15, column: 1, scope: !21) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 15, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !29) +// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) +// CHECK:STDOUT: !27 = !{null, !28} +// CHECK:STDOUT: !28 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !29 = !{!30} +// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !25, type: !28) +// CHECK:STDOUT: !31 = !DILocation(line: 15, column: 1, scope: !25) +// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.dd803598fd1f0f08:core.Destroy.Core", scope: null, file: !1, line: 15, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) +// CHECK:STDOUT: !33 = !{!34} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !17) +// CHECK:STDOUT: !35 = !DILocation(line: 15, column: 1, scope: !32) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp.68011419f123494e:core.Destroy.Core", scope: null, file: !1, line: 15, type: !15, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !37) +// CHECK:STDOUT: !37 = !{!38} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !17) +// CHECK:STDOUT: !39 = !DILocation(line: 15, column: 1, scope: !36) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/nullptr.carbon b/toolchain/lower/testdata/interop/cpp/nullptr.carbon index a00464a68cd00..a38c922a2738f 100644 --- a/toolchain/lower/testdata/interop/cpp/nullptr.carbon +++ b/toolchain/lower/testdata/interop/cpp/nullptr.carbon @@ -56,22 +56,22 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassNullptr.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CPassNullptr.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc12_18.2.temp = alloca ptr, align 8, !dbg !14 -// CHECK:STDOUT: %.loc14_22.1.temp = alloca ptr, align 8, !dbg !15 -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba"(ptr poison), !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_18.2.temp), !dbg !14 -// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, ptr %.loc12_18.2.temp, align 8, !dbg !14 -// CHECK:STDOUT: %.loc12_18.4 = load ptr, ptr %.loc12_18.2.temp, align 8, !dbg !14 -// CHECK:STDOUT: call void @_Z7TakePtrPi(ptr %.loc12_18.4), !dbg !16 -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !15 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_22.1.temp), !dbg !15 -// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, ptr %.loc14_22.1.temp, align 8, !dbg !15 -// CHECK:STDOUT: call void @_Z11TakeNullptrDn.carbon_thunk._(ptr %.loc14_22.1.temp), !dbg !17 -// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %.loc14_22.1.temp), !dbg !15 -// CHECK:STDOUT: call void @"_COp.9a41840f34ccc47a:core.Destroy.Core"(ptr %.loc12_18.2.temp), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: %.loc12_18.2.temp = alloca ptr, align 8, !dbg !15 +// CHECK:STDOUT: %.loc14_22.1.temp = alloca ptr, align 8, !dbg !16 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba"(ptr poison), !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_18.2.temp), !dbg !15 +// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, ptr %.loc12_18.2.temp, align 8, !dbg !15 +// CHECK:STDOUT: %.loc12_18.4 = load ptr, ptr %.loc12_18.2.temp, align 8, !dbg !15 +// CHECK:STDOUT: call void @_Z7TakePtrPi(ptr %.loc12_18.4), !dbg !17 +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !16 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_22.1.temp), !dbg !16 +// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, ptr %.loc14_22.1.temp, align 8, !dbg !16 +// CHECK:STDOUT: call void @_Z11TakeNullptrDn.carbon_thunk._(ptr %.loc14_22.1.temp), !dbg !18 +// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %.loc14_22.1.temp), !dbg !16 +// CHECK:STDOUT: call void @"_COp.9a41840f34ccc47a:core.Destroy.Core"(ptr %.loc12_18.2.temp), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z7TakePtrPi(ptr noundef) #1 @@ -80,8 +80,8 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: define internal void @_Z11TakeNullptrDn.carbon_thunk._(ptr noundef %n) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %n.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %n, ptr %n.addr, align 8, !tbaa !19 -// CHECK:STDOUT: %0 = load ptr, ptr %n.addr, align 8, !tbaa !19 +// CHECK:STDOUT: store ptr %n, ptr %n.addr, align 8, !tbaa !20 +// CHECK:STDOUT: %0 = load ptr, ptr %n.addr, align 8, !tbaa !20 // CHECK:STDOUT: call void @_Z11TakeNullptrDn(ptr null) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -89,107 +89,107 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: declare ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.fd39a15e7d61228d:core.Destroy.Core"(ptr %self) #0 !dbg !22 { +// CHECK:STDOUT: define weak_odr void @"_COp.fd39a15e7d61228d:core.Destroy.Core"(ptr %self) #0 !dbg !23 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.125695b29f2cf97c:core.Destroy.Core"(ptr %self) #0 !dbg !29 { +// CHECK:STDOUT: define weak_odr void @"_COp.125695b29f2cf97c:core.Destroy.Core"(ptr %self) #0 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %self) #0 !dbg !33 { +// CHECK:STDOUT: define weak_odr void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %self) #0 !dbg !34 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.32a070744df634d9:core.Destroy.Core"(ptr %self) #0 !dbg !37 { +// CHECK:STDOUT: define weak_odr void @"_COp.32a070744df634d9:core.Destroy.Core"(ptr %self) #0 !dbg !38 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: ret void, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.958634845f762cfe:core.Destroy.Core"(ptr %self) #0 !dbg !41 { +// CHECK:STDOUT: define weak_odr void @"_COp.958634845f762cfe:core.Destroy.Core"(ptr %self) #0 !dbg !42 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: ret void, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.9a41840f34ccc47a:core.Destroy.Core"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: define weak_odr void @"_COp.9a41840f34ccc47a:core.Destroy.Core"(ptr %self) #0 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnNullptr.Main() #0 !dbg !49 { +// CHECK:STDOUT: define ptr @_CReturnNullptr.Main() #0 !dbg !50 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !52 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, !dbg !53 +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !53 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call, !dbg !54 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnNullptrCopy.Main() #0 !dbg !54 { +// CHECK:STDOUT: define ptr @_CReturnNullptrCopy.Main() #0 !dbg !55 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !55 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !55 -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !56 -// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22, ptr %a.var, align 8, !dbg !55 -// CHECK:STDOUT: %.loc23 = load ptr, ptr %a.var, align 8, !dbg !57 -// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr %.loc23), !dbg !57 -// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %a.var), !dbg !55 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23, !dbg !58 +// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !56 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !56 +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr poison), !dbg !57 +// CHECK:STDOUT: store ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc22, ptr %a.var, align 8, !dbg !56 +// CHECK:STDOUT: %.loc23 = load ptr, ptr %a.var, align 8, !dbg !58 +// CHECK:STDOUT: %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23 = call ptr @"_COp.NullptrT.CppCompat.Core:Copy.Core"(ptr %.loc23), !dbg !58 +// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %a.var), !dbg !56 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.Copy.impl.Op.call.loc23, !dbg !59 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #0 !dbg !59 { +// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #0 !dbg !60 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !60 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !60 -// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %a.var), !dbg !61 -// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !62 -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba"(ptr %.loc28_10), !dbg !63 -// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %a.var), !dbg !60 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !63 +// CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !61 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !61 +// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %a.var), !dbg !62 +// CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !63 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba"(ptr %.loc28_10), !dbg !64 +// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %a.var), !dbg !61 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !64 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z13ReturnNullptrv.carbon_thunk.(ptr noundef %return) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !19 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !19 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !20 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !20 // CHECK:STDOUT: %call = call ptr @_Z13ReturnNullptrv() -// CHECK:STDOUT: store ptr %call, ptr %0, align 8, !tbaa !64 +// CHECK:STDOUT: store ptr %call, ptr %0, align 8, !tbaa !65 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrDirectly.Main() #0 !dbg !66 { +// CHECK:STDOUT: define ptr @_CReturnConvertedNullptrDirectly.Main() #0 !dbg !67 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !67 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !67 -// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %.loc32_28.1.temp), !dbg !67 -// CHECK:STDOUT: %.loc32_28.4 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !67 -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba"(ptr %.loc32_28.4), !dbg !68 -// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %.loc32_28.1.temp), !dbg !67 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !68 +// CHECK:STDOUT: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !68 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !68 +// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk.(ptr %.loc32_28.1.temp), !dbg !68 +// CHECK:STDOUT: %.loc32_28.4 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !68 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba"(ptr %.loc32_28.4), !dbg !69 +// CHECK:STDOUT: call void @"_COp.37a0be3fec6961f4:core.Destroy.Core"(ptr %.loc32_28.1.temp), !dbg !68 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CConvertNullptrConstant.Main() #0 !dbg !69 { +// CHECK:STDOUT: define ptr @_CConvertNullptrConstant.Main() #0 !dbg !70 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba"(ptr poison), !dbg !70 -// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !70 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba"(ptr poison), !dbg !71 +// CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !71 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba"(ptr %self) #0 !dbg !71 { -// CHECK:STDOUT: %1 = call ptr @_CNone.Optional.Core.0a6122c87ac9ba0f(), !dbg !77 -// CHECK:STDOUT: ret ptr %1, !dbg !78 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba"(ptr %self) #0 !dbg !72 { +// CHECK:STDOUT: %1 = call ptr @_CNone.Optional.Core.0a6122c87ac9ba0f(), !dbg !78 +// CHECK:STDOUT: ret ptr %1, !dbg !79 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -198,8 +198,8 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: declare ptr @_CMake.NullptrT.CppCompat.Core() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.0a6122c87ac9ba0f() #0 !dbg !79 { -// CHECK:STDOUT: ret ptr null, !dbg !81 +// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.0a6122c87ac9ba0f() #0 !dbg !80 { +// CHECK:STDOUT: ret ptr null, !dbg !82 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z11TakeNullptrDn(ptr) #1 @@ -226,79 +226,80 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "PassNullptr", linkageName: "_CPassNullptr.Main", scope: null, file: !1, line: 11, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 12, column: 15, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 14, column: 19, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 12, column: 3, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 14, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 11, column: 1, scope: !11) -// CHECK:STDOUT: !19 = !{!20, !20, i64 0} -// CHECK:STDOUT: !20 = !{!"p1 std::nullptr_t", !21, i64 0} -// CHECK:STDOUT: !21 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fd39a15e7d61228d:core.Destroy.Core", scope: null, file: !1, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) -// CHECK:STDOUT: !23 = !DISubroutineType(types: !24) -// CHECK:STDOUT: !24 = !{null, !25} -// CHECK:STDOUT: !25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !26 = !{!27} -// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !22, type: !25) -// CHECK:STDOUT: !28 = !DILocation(line: 14, column: 19, scope: !22) -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.125695b29f2cf97c:core.Destroy.Core", scope: null, file: !1, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) -// CHECK:STDOUT: !30 = !{!31} -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !25) -// CHECK:STDOUT: !32 = !DILocation(line: 14, column: 19, scope: !29) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.37a0be3fec6961f4:core.Destroy.Core", scope: null, file: !1, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34) -// CHECK:STDOUT: !34 = !{!35} -// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !25) -// CHECK:STDOUT: !36 = !DILocation(line: 14, column: 19, scope: !33) -// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.32a070744df634d9:core.Destroy.Core", scope: null, file: !1, line: 12, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38) -// CHECK:STDOUT: !38 = !{!39} -// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !25) -// CHECK:STDOUT: !40 = !DILocation(line: 12, column: 15, scope: !37) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.958634845f762cfe:core.Destroy.Core", scope: null, file: !1, line: 12, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !42) -// CHECK:STDOUT: !42 = !{!43} -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !25) -// CHECK:STDOUT: !44 = !DILocation(line: 12, column: 15, scope: !41) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9a41840f34ccc47a:core.Destroy.Core", scope: null, file: !1, line: 12, type: !23, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !46) -// CHECK:STDOUT: !46 = !{!47} -// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !25) -// CHECK:STDOUT: !48 = !DILocation(line: 12, column: 15, scope: !45) -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !1, line: 17, type: !50, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !50 = !DISubroutineType(types: !51) -// CHECK:STDOUT: !51 = !{!25} -// CHECK:STDOUT: !52 = !DILocation(line: 18, column: 10, scope: !49) -// CHECK:STDOUT: !53 = !DILocation(line: 18, column: 3, scope: !49) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !1, line: 21, type: !50, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !55 = !DILocation(line: 22, column: 3, scope: !54) -// CHECK:STDOUT: !56 = !DILocation(line: 22, column: 26, scope: !54) -// CHECK:STDOUT: !57 = !DILocation(line: 23, column: 10, scope: !54) -// CHECK:STDOUT: !58 = !DILocation(line: 23, column: 3, scope: !54) -// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "ReturnConvertedNullptrIndirectly", linkageName: "_CReturnConvertedNullptrIndirectly.Main", scope: null, file: !1, line: 26, type: !50, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !60 = !DILocation(line: 27, column: 3, scope: !59) -// CHECK:STDOUT: !61 = !DILocation(line: 27, column: 26, scope: !59) -// CHECK:STDOUT: !62 = !DILocation(line: 28, column: 10, scope: !59) -// CHECK:STDOUT: !63 = !DILocation(line: 28, column: 3, scope: !59) -// CHECK:STDOUT: !64 = !{!65, !65, i64 0} -// CHECK:STDOUT: !65 = !{!"std::nullptr_t", !9, i64 0} -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "ReturnConvertedNullptrDirectly", linkageName: "_CReturnConvertedNullptrDirectly.Main", scope: null, file: !1, line: 31, type: !50, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !67 = !DILocation(line: 32, column: 10, scope: !66) -// CHECK:STDOUT: !68 = !DILocation(line: 32, column: 3, scope: !66) -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "ConvertNullptrConstant", linkageName: "_CConvertNullptrConstant.Main", scope: null, file: !1, line: 35, type: !50, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !70 = !DILocation(line: 36, column: 3, scope: !69) -// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba", scope: null, file: !72, line: 51, type: !73, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !75) -// CHECK:STDOUT: !72 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "") -// CHECK:STDOUT: !73 = !DISubroutineType(types: !74) -// CHECK:STDOUT: !74 = !{!25, !25} -// CHECK:STDOUT: !75 = !{!76} -// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !71, type: !25) -// CHECK:STDOUT: !77 = !DILocation(line: 52, column: 14, scope: !71) -// CHECK:STDOUT: !78 = !DILocation(line: 52, column: 7, scope: !71) -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.0a6122c87ac9ba0f", scope: null, file: !80, line: 30, type: !50, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !80 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !81 = !DILocation(line: 31, column: 5, scope: !79) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "PassNullptr", linkageName: "_CPassNullptr.Main", scope: null, file: !1, line: 11, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 12, column: 15, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 14, column: 19, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 3, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 14, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 11, column: 1, scope: !12) +// CHECK:STDOUT: !20 = !{!21, !21, i64 0} +// CHECK:STDOUT: !21 = !{!"p1 std::nullptr_t", !22, i64 0} +// CHECK:STDOUT: !22 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fd39a15e7d61228d:core.Destroy.Core", scope: null, file: !1, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !27) +// CHECK:STDOUT: !24 = !DISubroutineType(types: !25) +// CHECK:STDOUT: !25 = !{null, !26} +// CHECK:STDOUT: !26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !27 = !{!28} +// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !23, type: !26) +// CHECK:STDOUT: !29 = !DILocation(line: 14, column: 19, scope: !23) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp.125695b29f2cf97c:core.Destroy.Core", scope: null, file: !1, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !26) +// CHECK:STDOUT: !33 = !DILocation(line: 14, column: 19, scope: !30) +// CHECK:STDOUT: !34 = distinct !DISubprogram(name: "Op", linkageName: "_COp.37a0be3fec6961f4:core.Destroy.Core", scope: null, file: !1, line: 14, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !35) +// CHECK:STDOUT: !35 = !{!36} +// CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !26) +// CHECK:STDOUT: !37 = !DILocation(line: 14, column: 19, scope: !34) +// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.32a070744df634d9:core.Destroy.Core", scope: null, file: !1, line: 12, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !39) +// CHECK:STDOUT: !39 = !{!40} +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !26) +// CHECK:STDOUT: !41 = !DILocation(line: 12, column: 15, scope: !38) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Op", linkageName: "_COp.958634845f762cfe:core.Destroy.Core", scope: null, file: !1, line: 12, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43) +// CHECK:STDOUT: !43 = !{!44} +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !42, type: !26) +// CHECK:STDOUT: !45 = !DILocation(line: 12, column: 15, scope: !42) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9a41840f34ccc47a:core.Destroy.Core", scope: null, file: !1, line: 12, type: !24, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !47) +// CHECK:STDOUT: !47 = !{!48} +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !26) +// CHECK:STDOUT: !49 = !DILocation(line: 12, column: 15, scope: !46) +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "ReturnNullptr", linkageName: "_CReturnNullptr.Main", scope: null, file: !1, line: 17, type: !51, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !51 = !DISubroutineType(types: !52) +// CHECK:STDOUT: !52 = !{!26} +// CHECK:STDOUT: !53 = !DILocation(line: 18, column: 10, scope: !50) +// CHECK:STDOUT: !54 = !DILocation(line: 18, column: 3, scope: !50) +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "ReturnNullptrCopy", linkageName: "_CReturnNullptrCopy.Main", scope: null, file: !1, line: 21, type: !51, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !56 = !DILocation(line: 22, column: 3, scope: !55) +// CHECK:STDOUT: !57 = !DILocation(line: 22, column: 26, scope: !55) +// CHECK:STDOUT: !58 = !DILocation(line: 23, column: 10, scope: !55) +// CHECK:STDOUT: !59 = !DILocation(line: 23, column: 3, scope: !55) +// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "ReturnConvertedNullptrIndirectly", linkageName: "_CReturnConvertedNullptrIndirectly.Main", scope: null, file: !1, line: 26, type: !51, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !61 = !DILocation(line: 27, column: 3, scope: !60) +// CHECK:STDOUT: !62 = !DILocation(line: 27, column: 26, scope: !60) +// CHECK:STDOUT: !63 = !DILocation(line: 28, column: 10, scope: !60) +// CHECK:STDOUT: !64 = !DILocation(line: 28, column: 3, scope: !60) +// CHECK:STDOUT: !65 = !{!66, !66, i64 0} +// CHECK:STDOUT: !66 = !{!"std::nullptr_t", !10, i64 0} +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "ReturnConvertedNullptrDirectly", linkageName: "_CReturnConvertedNullptrDirectly.Main", scope: null, file: !1, line: 31, type: !51, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !68 = !DILocation(line: 32, column: 10, scope: !67) +// CHECK:STDOUT: !69 = !DILocation(line: 32, column: 3, scope: !67) +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "ConvertNullptrConstant", linkageName: "_CConvertNullptrConstant.Main", scope: null, file: !1, line: 35, type: !51, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !71 = !DILocation(line: 36, column: 3, scope: !70) +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.NullptrT.CppCompat.Core:ImplicitAs.f8357062f5b0e57c.Core.84588f41d61dafba", scope: null, file: !73, line: 51, type: !74, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !76) +// CHECK:STDOUT: !73 = !DIFile(filename: "{{.*}}/prelude/types/cpp/nullptr.carbon", directory: "") +// CHECK:STDOUT: !74 = !DISubroutineType(types: !75) +// CHECK:STDOUT: !75 = !{!26, !26} +// CHECK:STDOUT: !76 = !{!77} +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !72, type: !26) +// CHECK:STDOUT: !78 = !DILocation(line: 52, column: 14, scope: !72) +// CHECK:STDOUT: !79 = !DILocation(line: 52, column: 7, scope: !72) +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.0a6122c87ac9ba0f", scope: null, file: !81, line: 30, type: !51, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !81 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !82 = !DILocation(line: 31, column: 5, scope: !80) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/operators.carbon b/toolchain/lower/testdata/interop/cpp/operators.carbon index a9af78e94599a..795667417d89d 100644 --- a/toolchain/lower/testdata/interop/cpp/operators.carbon +++ b/toolchain/lower/testdata/interop/cpp/operators.carbon @@ -87,10 +87,10 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: $_Zne1AS_ = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CDriver.Main(ptr %x, ptr %y) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CDriver.Main(ptr %x, ptr %y) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CCheckEqWith.Main.bdef5a2ed02e32a1(ptr %x, ptr %y), !dbg !18 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: call void @_CCheckEqWith.Main.bdef5a2ed02e32a1(ptr %x, ptr %y), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -101,21 +101,21 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 // CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4 -// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !25 -// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26 // CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 // CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0 // CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4 // CHECK:STDOUT: %call = call noundef zeroext i1 @_Zeq1AS_(i32 %3, i32 %4) // CHECK:STDOUT: %storedv = zext i1 %call to i8 -// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !26 +// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !28 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -127,50 +127,50 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 // CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4 -// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !25 -// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26 // CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 // CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0 // CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4 // CHECK:STDOUT: %call = call noundef zeroext i1 @_Zne1AS_(i32 %3, i32 %4) // CHECK:STDOUT: %storedv = zext i1 %call to i8 -// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !26 +// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !28 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define i1 @"_CEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !28 { +// CHECK:STDOUT: define i1 @"_CEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !34 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !34 -// CHECK:STDOUT: call void @_Zeq1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !34 -// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !34 -// CHECK:STDOUT: ret i1 %0, !dbg !34 +// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !36 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !36 +// CHECK:STDOUT: call void @_Zeq1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !36 +// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !36 +// CHECK:STDOUT: ret i1 %0, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define i1 @"_CNotEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !35 { +// CHECK:STDOUT: define i1 @"_CNotEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !39 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !39 -// CHECK:STDOUT: call void @_Zne1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !39 -// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !39 -// CHECK:STDOUT: ret i1 %0, !dbg !39 +// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !41 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !41 +// CHECK:STDOUT: call void @_Zne1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !41 +// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !41 +// CHECK:STDOUT: ret i1 %0, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCheckEqWith.Main.bdef5a2ed02e32a1(ptr %x, ptr %y) #0 !dbg !40 { +// CHECK:STDOUT: define linkonce_odr void @_CCheckEqWith.Main.bdef5a2ed02e32a1(ptr %x, ptr %y) #0 !dbg !42 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp"(ptr %x, ptr %y), !dbg !44 -// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.call = call i1 @"_CNotEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp"(ptr %x, ptr %y), !dbg !45 -// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp"(ptr %x, ptr %y), !dbg !46 +// CHECK:STDOUT: %EqWith.WithSelf.NotEqual.call = call i1 @"_CNotEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp"(ptr %x, ptr %y), !dbg !47 +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -186,9 +186,9 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 // CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 // CHECK:STDOUT: %value = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0 -// CHECK:STDOUT: %0 = load i32, ptr %value, align 4, !tbaa !47 +// CHECK:STDOUT: %0 = load i32, ptr %value, align 4, !tbaa !49 // CHECK:STDOUT: %value2 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 -// CHECK:STDOUT: %1 = load i32, ptr %value2, align 4, !tbaa !47 +// CHECK:STDOUT: %1 = load i32, ptr %value2, align 4, !tbaa !49 // CHECK:STDOUT: %cmp = icmp eq i32 %0, %1 // CHECK:STDOUT: ret i1 %cmp // CHECK:STDOUT: } @@ -207,8 +207,8 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4 // CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 // CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !25 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !26 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !26 // CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4 // CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp2, i32 0, i32 0 @@ -239,48 +239,50 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Driver", linkageName: "_CDriver.Main", scope: null, file: !1, line: 23, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16, !17} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 2, scope: !11, type: !14) -// CHECK:STDOUT: !18 = !DILocation(line: 24, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 23, column: 1, scope: !11) -// CHECK:STDOUT: !20 = !{!21, !21, i64 0} -// CHECK:STDOUT: !21 = !{!"p1 _ZTS1A", !22, i64 0} -// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !23 = !{!24, !24, i64 0} -// CHECK:STDOUT: !24 = !{!"p1 bool", !22, i64 0} -// CHECK:STDOUT: !25 = !{i64 0, i64 4, !7} -// CHECK:STDOUT: !26 = !{!27, !27, i64 0} -// CHECK:STDOUT: !27 = !{!"bool", !9, i64 0} -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp", scope: null, file: !1, line: 8, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) -// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) -// CHECK:STDOUT: !30 = !{!14, !14, !14} -// CHECK:STDOUT: !31 = !{!32, !33} -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !14) -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 2, scope: !28, type: !14) -// CHECK:STDOUT: !34 = !DILocation(line: 8, column: 15, scope: !28) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp", scope: null, file: !1, line: 12, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !36) -// CHECK:STDOUT: !36 = !{!37, !38} -// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !14) -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 2, scope: !35, type: !14) -// CHECK:STDOUT: !39 = !DILocation(line: 12, column: 15, scope: !35) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "CheckEqWith", linkageName: "_CCheckEqWith.Main.bdef5a2ed02e32a1", scope: null, file: !1, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !41) -// CHECK:STDOUT: !41 = !{!42, !43} -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !14) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 2, scope: !40, type: !14) -// CHECK:STDOUT: !44 = !DILocation(line: 19, column: 3, scope: !40) -// CHECK:STDOUT: !45 = !DILocation(line: 20, column: 3, scope: !40) -// CHECK:STDOUT: !46 = !DILocation(line: 18, column: 1, scope: !40) -// CHECK:STDOUT: !47 = !{!48, !8, i64 0} -// CHECK:STDOUT: !48 = !{!"_ZTS1A", !8, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Driver", linkageName: "_CDriver.Main", scope: null, file: !1, line: 23, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17, !18} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 2, scope: !12, type: !15) +// CHECK:STDOUT: !19 = !DILocation(line: 24, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 23, column: 1, scope: !12) +// CHECK:STDOUT: !21 = !{!22, !22, i64 0} +// CHECK:STDOUT: !22 = !{!"p1 _ZTS1A", !23, i64 0} +// CHECK:STDOUT: !23 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !24 = !{!25, !25, i64 0} +// CHECK:STDOUT: !25 = !{!"p1 bool", !23, i64 0} +// CHECK:STDOUT: !26 = !{i64 0, i64 4, !27} +// CHECK:STDOUT: !27 = !{!9, !9, i64 0} +// CHECK:STDOUT: !28 = !{!29, !29, i64 0} +// CHECK:STDOUT: !29 = !{!"bool", !10, i64 0} +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp", scope: null, file: !1, line: 8, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) +// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) +// CHECK:STDOUT: !32 = !{!15, !15, !15} +// CHECK:STDOUT: !33 = !{!34, !35} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !30, type: !15) +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 2, scope: !30, type: !15) +// CHECK:STDOUT: !36 = !DILocation(line: 8, column: 15, scope: !30) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.ffb401eeee8c4872.Core:Cpp", scope: null, file: !1, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38) +// CHECK:STDOUT: !38 = !{!39, !40} +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !15) +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 2, scope: !37, type: !15) +// CHECK:STDOUT: !41 = !DILocation(line: 12, column: 15, scope: !37) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "CheckEqWith", linkageName: "_CCheckEqWith.Main.bdef5a2ed02e32a1", scope: null, file: !1, line: 18, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43) +// CHECK:STDOUT: !43 = !{!44, !45} +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !42, type: !15) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 2, scope: !42, type: !15) +// CHECK:STDOUT: !46 = !DILocation(line: 19, column: 3, scope: !42) +// CHECK:STDOUT: !47 = !DILocation(line: 20, column: 3, scope: !42) +// CHECK:STDOUT: !48 = !DILocation(line: 18, column: 1, scope: !42) +// CHECK:STDOUT: !49 = !{!50, !9, i64 0} +// CHECK:STDOUT: !50 = !{!"_ZTS1A", !9, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'ordered_with.carbon' @@ -299,10 +301,10 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: $_Zge1AS_ = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CDriver.Main(ptr %x, ptr %y) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CDriver.Main(ptr %x, ptr %y) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CCheckOrderedWith.Main.c49adfa90bd18905(ptr %x, ptr %y), !dbg !18 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: call void @_CCheckOrderedWith.Main.c49adfa90bd18905(ptr %x, ptr %y), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -313,21 +315,21 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 // CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4 -// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !25 -// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26 // CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 // CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0 // CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4 // CHECK:STDOUT: %call = call noundef zeroext i1 @_Zlt1AS_(i32 %3, i32 %4) // CHECK:STDOUT: %storedv = zext i1 %call to i8 -// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !26 +// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !28 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -339,21 +341,21 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 // CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4 -// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !25 -// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26 // CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 // CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0 // CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4 // CHECK:STDOUT: %call = call noundef zeroext i1 @_Zle1AS_(i32 %3, i32 %4) // CHECK:STDOUT: %storedv = zext i1 %call to i8 -// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !26 +// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !28 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -365,21 +367,21 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 // CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4 -// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !25 -// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26 // CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 // CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0 // CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4 // CHECK:STDOUT: %call = call noundef zeroext i1 @_Zgt1AS_(i32 %3, i32 %4) // CHECK:STDOUT: %storedv = zext i1 %call to i8 -// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !26 +// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !28 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -391,72 +393,72 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.A, align 4 // CHECK:STDOUT: %agg.tmp1 = alloca %struct.A, align 4 -// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !25 -// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !20 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !26 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !21 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !26 // CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 // CHECK:STDOUT: %coerce.dive2 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp1, i32 0, i32 0 // CHECK:STDOUT: %4 = load i32, ptr %coerce.dive2, align 4 // CHECK:STDOUT: %call = call noundef zeroext i1 @_Zge1AS_(i32 %3, i32 %4) // CHECK:STDOUT: %storedv = zext i1 %call to i8 -// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !26 +// CHECK:STDOUT: store i8 %storedv, ptr %0, align 1, !tbaa !28 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define i1 @"_CLess:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !28 { +// CHECK:STDOUT: define i1 @"_CLess:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !34 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !34 -// CHECK:STDOUT: call void @_Zlt1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !34 -// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !34 -// CHECK:STDOUT: ret i1 %0, !dbg !34 +// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !36 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !36 +// CHECK:STDOUT: call void @_Zlt1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !36 +// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !36 +// CHECK:STDOUT: ret i1 %0, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define i1 @"_CLessOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !35 { +// CHECK:STDOUT: define i1 @"_CLessOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !39 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !39 -// CHECK:STDOUT: call void @_Zle1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !39 -// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !39 -// CHECK:STDOUT: ret i1 %0, !dbg !39 +// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !41 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !41 +// CHECK:STDOUT: call void @_Zle1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !41 +// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !41 +// CHECK:STDOUT: ret i1 %0, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define i1 @"_CGreater:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !40 { +// CHECK:STDOUT: define i1 @"_CGreater:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !42 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !44 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !44 -// CHECK:STDOUT: call void @_Zgt1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !44 -// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !44 -// CHECK:STDOUT: ret i1 %0, !dbg !44 +// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !46 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !46 +// CHECK:STDOUT: call void @_Zgt1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !46 +// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !46 +// CHECK:STDOUT: ret i1 %0, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !45 { +// CHECK:STDOUT: define i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !47 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !49 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !49 -// CHECK:STDOUT: call void @_Zge1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !49 -// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !49 -// CHECK:STDOUT: ret i1 %0, !dbg !49 +// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !51 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !51 +// CHECK:STDOUT: call void @_Zge1AS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !51 +// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !51 +// CHECK:STDOUT: ret i1 %0, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCheckOrderedWith.Main.c49adfa90bd18905(ptr %x, ptr %y) #0 !dbg !50 { +// CHECK:STDOUT: define linkonce_odr void @_CCheckOrderedWith.Main.c49adfa90bd18905(ptr %x, ptr %y) #0 !dbg !52 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %OrderedWith.WithSelf.Less.call = call i1 @"_CLess:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %x, ptr %y), !dbg !54 -// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.call = call i1 @"_CGreater:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %x, ptr %y), !dbg !55 -// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.call = call i1 @"_CLessOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %x, ptr %y), !dbg !56 -// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.call = call i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %x, ptr %y), !dbg !57 -// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.call = call i1 @"_CLess:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %x, ptr %y), !dbg !56 +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.call = call i1 @"_CGreater:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %x, ptr %y), !dbg !57 +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.call = call i1 @"_CLessOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %x, ptr %y), !dbg !58 +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.call = call i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp"(ptr %x, ptr %y), !dbg !59 +// CHECK:STDOUT: ret void, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -472,9 +474,9 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 // CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 // CHECK:STDOUT: %value = getelementptr inbounds nuw %struct.A, ptr %x, i32 0, i32 0 -// CHECK:STDOUT: %0 = load i32, ptr %value, align 4, !tbaa !59 +// CHECK:STDOUT: %0 = load i32, ptr %value, align 4, !tbaa !61 // CHECK:STDOUT: %value2 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 -// CHECK:STDOUT: %1 = load i32, ptr %value2, align 4, !tbaa !59 +// CHECK:STDOUT: %1 = load i32, ptr %value2, align 4, !tbaa !61 // CHECK:STDOUT: %cmp = icmp slt i32 %0, %1 // CHECK:STDOUT: ret i1 %cmp // CHECK:STDOUT: } @@ -493,8 +495,8 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4 // CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 // CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !25 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !26 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !26 // CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4 // CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp2, i32 0, i32 0 @@ -515,8 +517,8 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4 // CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 // CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !25 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !26 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !26 // CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4 // CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp2, i32 0, i32 0 @@ -536,8 +538,8 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: store i32 %x.coerce, ptr %coerce.dive, align 4 // CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.A, ptr %y, i32 0, i32 0 // CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !25 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !25 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %x, i64 4, i1 false), !tbaa.struct !26 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp2, ptr align 4 %y, i64 4, i1 false), !tbaa.struct !26 // CHECK:STDOUT: %coerce.dive3 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %0 = load i32, ptr %coerce.dive3, align 4 // CHECK:STDOUT: %coerce.dive4 = getelementptr inbounds nuw %struct.A, ptr %agg.tmp2, i32 0, i32 0 @@ -568,58 +570,60 @@ fn Driver(x: Cpp.A, y: Cpp.A) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Driver", linkageName: "_CDriver.Main", scope: null, file: !1, line: 33, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16, !17} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 2, scope: !11, type: !14) -// CHECK:STDOUT: !18 = !DILocation(line: 34, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 33, column: 1, scope: !11) -// CHECK:STDOUT: !20 = !{!21, !21, i64 0} -// CHECK:STDOUT: !21 = !{!"p1 _ZTS1A", !22, i64 0} -// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !23 = !{!24, !24, i64 0} -// CHECK:STDOUT: !24 = !{!"p1 bool", !22, i64 0} -// CHECK:STDOUT: !25 = !{i64 0, i64 4, !7} -// CHECK:STDOUT: !26 = !{!27, !27, i64 0} -// CHECK:STDOUT: !27 = !{!"bool", !9, i64 0} -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Less", linkageName: "_CLess:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp", scope: null, file: !1, line: 8, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) -// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) -// CHECK:STDOUT: !30 = !{!14, !14, !14} -// CHECK:STDOUT: !31 = !{!32, !33} -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !14) -// CHECK:STDOUT: !33 = !DILocalVariable(arg: 2, scope: !28, type: !14) -// CHECK:STDOUT: !34 = !DILocation(line: 8, column: 15, scope: !28) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "LessOrEquivalent", linkageName: "_CLessOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp", scope: null, file: !1, line: 16, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !36) -// CHECK:STDOUT: !36 = !{!37, !38} -// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !14) -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 2, scope: !35, type: !14) -// CHECK:STDOUT: !39 = !DILocation(line: 16, column: 15, scope: !35) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Greater", linkageName: "_CGreater:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp", scope: null, file: !1, line: 12, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !41) -// CHECK:STDOUT: !41 = !{!42, !43} -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !14) -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 2, scope: !40, type: !14) -// CHECK:STDOUT: !44 = !DILocation(line: 12, column: 15, scope: !40) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "GreaterOrEquivalent", linkageName: "_CGreaterOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp", scope: null, file: !1, line: 20, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !46) -// CHECK:STDOUT: !46 = !{!47, !48} -// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !14) -// CHECK:STDOUT: !48 = !DILocalVariable(arg: 2, scope: !45, type: !14) -// CHECK:STDOUT: !49 = !DILocation(line: 20, column: 15, scope: !45) -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "CheckOrderedWith", linkageName: "_CCheckOrderedWith.Main.c49adfa90bd18905", scope: null, file: !1, line: 26, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !51) -// CHECK:STDOUT: !51 = !{!52, !53} -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !50, type: !14) -// CHECK:STDOUT: !53 = !DILocalVariable(arg: 2, scope: !50, type: !14) -// CHECK:STDOUT: !54 = !DILocation(line: 27, column: 3, scope: !50) -// CHECK:STDOUT: !55 = !DILocation(line: 28, column: 3, scope: !50) -// CHECK:STDOUT: !56 = !DILocation(line: 29, column: 3, scope: !50) -// CHECK:STDOUT: !57 = !DILocation(line: 30, column: 3, scope: !50) -// CHECK:STDOUT: !58 = !DILocation(line: 26, column: 1, scope: !50) -// CHECK:STDOUT: !59 = !{!60, !8, i64 0} -// CHECK:STDOUT: !60 = !{!"_ZTS1A", !8, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Driver", linkageName: "_CDriver.Main", scope: null, file: !1, line: 33, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17, !18} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 2, scope: !12, type: !15) +// CHECK:STDOUT: !19 = !DILocation(line: 34, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 33, column: 1, scope: !12) +// CHECK:STDOUT: !21 = !{!22, !22, i64 0} +// CHECK:STDOUT: !22 = !{!"p1 _ZTS1A", !23, i64 0} +// CHECK:STDOUT: !23 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !24 = !{!25, !25, i64 0} +// CHECK:STDOUT: !25 = !{!"p1 bool", !23, i64 0} +// CHECK:STDOUT: !26 = !{i64 0, i64 4, !27} +// CHECK:STDOUT: !27 = !{!9, !9, i64 0} +// CHECK:STDOUT: !28 = !{!29, !29, i64 0} +// CHECK:STDOUT: !29 = !{!"bool", !10, i64 0} +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Less", linkageName: "_CLess:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp", scope: null, file: !1, line: 8, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) +// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) +// CHECK:STDOUT: !32 = !{!15, !15, !15} +// CHECK:STDOUT: !33 = !{!34, !35} +// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !30, type: !15) +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 2, scope: !30, type: !15) +// CHECK:STDOUT: !36 = !DILocation(line: 8, column: 15, scope: !30) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "LessOrEquivalent", linkageName: "_CLessOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp", scope: null, file: !1, line: 16, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38) +// CHECK:STDOUT: !38 = !{!39, !40} +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !15) +// CHECK:STDOUT: !40 = !DILocalVariable(arg: 2, scope: !37, type: !15) +// CHECK:STDOUT: !41 = !DILocation(line: 16, column: 15, scope: !37) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "Greater", linkageName: "_CGreater:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp", scope: null, file: !1, line: 12, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43) +// CHECK:STDOUT: !43 = !{!44, !45} +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !42, type: !15) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 2, scope: !42, type: !15) +// CHECK:STDOUT: !46 = !DILocation(line: 12, column: 15, scope: !42) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "GreaterOrEquivalent", linkageName: "_CGreaterOrEquivalent:thunk:OrderedWith.92c0df05bd55f97a.Core:Cpp", scope: null, file: !1, line: 20, type: !31, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !48) +// CHECK:STDOUT: !48 = !{!49, !50} +// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !47, type: !15) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 2, scope: !47, type: !15) +// CHECK:STDOUT: !51 = !DILocation(line: 20, column: 15, scope: !47) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "CheckOrderedWith", linkageName: "_CCheckOrderedWith.Main.c49adfa90bd18905", scope: null, file: !1, line: 26, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !53) +// CHECK:STDOUT: !53 = !{!54, !55} +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !52, type: !15) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 2, scope: !52, type: !15) +// CHECK:STDOUT: !56 = !DILocation(line: 27, column: 3, scope: !52) +// CHECK:STDOUT: !57 = !DILocation(line: 28, column: 3, scope: !52) +// CHECK:STDOUT: !58 = !DILocation(line: 29, column: 3, scope: !52) +// CHECK:STDOUT: !59 = !DILocation(line: 30, column: 3, scope: !52) +// CHECK:STDOUT: !60 = !DILocation(line: 26, column: 1, scope: !52) +// CHECK:STDOUT: !61 = !{!62, !9, i64 0} +// CHECK:STDOUT: !62 = !{!"_ZTS1A", !9, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/pointer.carbon b/toolchain/lower/testdata/interop/cpp/pointer.carbon index 9dd00cc32f9fa..18e2298247392 100644 --- a/toolchain/lower/testdata/interop/cpp/pointer.carbon +++ b/toolchain/lower/testdata/interop/cpp/pointer.carbon @@ -109,45 +109,45 @@ fn Convert() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassPtr.Main(ptr %p) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CPassPtr.Main(ptr %p) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z7TakePtrP1C(ptr %p), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: call void @_Z7TakePtrP1C(ptr %p), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z7TakePtrP1C(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !19 { +// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !22 -// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !23 +// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !23 +// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z9ReturnPtrv() #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %p) #0 !dbg !24 { +// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %p) #0 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr %p), !dbg !27 -// CHECK:STDOUT: ret void, !dbg !28 +// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr %p), !dbg !28 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !29 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !29 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !30 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !30 // CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci(ptr noundef %1, i32 noundef 0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !32 { +// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk.(), !dbg !33 -// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !34 +// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk.(), !dbg !34 +// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -176,34 +176,35 @@ fn Convert() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !1, line: 14, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 15, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 14, column: 1, scope: !11) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !1, line: 18, type: !20, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) -// CHECK:STDOUT: !21 = !{!14} -// CHECK:STDOUT: !22 = !DILocation(line: 19, column: 10, scope: !19) -// CHECK:STDOUT: !23 = !DILocation(line: 19, column: 3, scope: !19) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !1, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !25) -// CHECK:STDOUT: !25 = !{!26} -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !24, type: !14) -// CHECK:STDOUT: !27 = !DILocation(line: 23, column: 3, scope: !24) -// CHECK:STDOUT: !28 = !DILocation(line: 22, column: 1, scope: !24) -// CHECK:STDOUT: !29 = !{!30, !30, i64 0} -// CHECK:STDOUT: !30 = !{!"p1 _ZTS1C", !31, i64 0} -// CHECK:STDOUT: !31 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !1, line: 26, type: !20, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !33 = !DILocation(line: 27, column: 10, scope: !32) -// CHECK:STDOUT: !34 = !DILocation(line: 27, column: 3, scope: !32) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !1, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 15, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 14, column: 1, scope: !12) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !1, line: 18, type: !21, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !21 = !DISubroutineType(types: !22) +// CHECK:STDOUT: !22 = !{!15} +// CHECK:STDOUT: !23 = !DILocation(line: 19, column: 10, scope: !20) +// CHECK:STDOUT: !24 = !DILocation(line: 19, column: 3, scope: !20) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !15) +// CHECK:STDOUT: !28 = !DILocation(line: 23, column: 3, scope: !25) +// CHECK:STDOUT: !29 = !DILocation(line: 22, column: 1, scope: !25) +// CHECK:STDOUT: !30 = !{!31, !31, i64 0} +// CHECK:STDOUT: !31 = !{!"p1 _ZTS1C", !32, i64 0} +// CHECK:STDOUT: !32 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !1, line: 26, type: !21, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !34 = !DILocation(line: 27, column: 10, scope: !33) +// CHECK:STDOUT: !35 = !DILocation(line: 27, column: 3, scope: !33) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'nullable.carbon' @@ -212,87 +213,87 @@ fn Convert() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassPtr.Main(ptr %_) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CPassPtr.Main(ptr %_) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !17 +// CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassNonnullPtr.Main(ptr %p) #0 !dbg !18 { +// CHECK:STDOUT: define void @_CPassNonnullPtr.Main(ptr %p) #0 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22_15.2.temp = alloca ptr, align 8, !dbg !21 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.718daad32622d4f5"(ptr %p), !dbg !21 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_15.2.temp), !dbg !21 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_15.2.temp, align 8, !dbg !21 -// CHECK:STDOUT: %.loc22_15.4 = load ptr, ptr %.loc22_15.2.temp, align 8, !dbg !21 -// CHECK:STDOUT: call void @_Z7TakePtrP1C(ptr %.loc22_15.4), !dbg !22 -// CHECK:STDOUT: call void @"_COp.1341c5e44ed8ed9c:core.Destroy.Core"(ptr %.loc22_15.2.temp), !dbg !21 -// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: %.loc22_15.2.temp = alloca ptr, align 8, !dbg !22 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.718daad32622d4f5"(ptr %p), !dbg !22 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_15.2.temp), !dbg !22 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_15.2.temp, align 8, !dbg !22 +// CHECK:STDOUT: %.loc22_15.4 = load ptr, ptr %.loc22_15.2.temp, align 8, !dbg !22 +// CHECK:STDOUT: call void @_Z7TakePtrP1C(ptr %.loc22_15.4), !dbg !23 +// CHECK:STDOUT: call void @"_COp.1341c5e44ed8ed9c:core.Destroy.Core"(ptr %.loc22_15.2.temp), !dbg !22 +// CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z7TakePtrP1C(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b66d38b36d1f26ac:core.Destroy.Core"(ptr %self) #0 !dbg !24 { +// CHECK:STDOUT: define weak_odr void @"_COp.b66d38b36d1f26ac:core.Destroy.Core"(ptr %self) #0 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0eaa291c18f0461d:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// CHECK:STDOUT: define weak_odr void @"_COp.0eaa291c18f0461d:core.Destroy.Core"(ptr %self) #0 !dbg !29 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.1341c5e44ed8ed9c:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_COp.1341c5e44ed8ed9c:core.Destroy.Core"(ptr %self) #0 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !36 { +// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !39 -// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !40 +// CHECK:STDOUT: %ReturnPtr.call = call ptr @_Z9ReturnPtrv(), !dbg !40 +// CHECK:STDOUT: ret ptr %ReturnPtr.call, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z9ReturnPtrv() #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %_) #0 !dbg !41 { +// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %_) #0 !dbg !42 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: ret void, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !45 { +// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc35_24.2.temp = alloca ptr, align 8, !dbg !48 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.718daad32622d4f5"(ptr %p), !dbg !48 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_24.2.temp), !dbg !48 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_24.2.temp, align 8, !dbg !48 -// CHECK:STDOUT: %.loc35_24.4 = load ptr, ptr %.loc35_24.2.temp, align 8, !dbg !48 -// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr %.loc35_24.4), !dbg !49 -// CHECK:STDOUT: call void @"_COp.1341c5e44ed8ed9c:core.Destroy.Core"(ptr %.loc35_24.2.temp), !dbg !48 -// CHECK:STDOUT: ret void, !dbg !50 +// CHECK:STDOUT: %.loc35_24.2.temp = alloca ptr, align 8, !dbg !49 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.718daad32622d4f5"(ptr %p), !dbg !49 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_24.2.temp), !dbg !49 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_24.2.temp, align 8, !dbg !49 +// CHECK:STDOUT: %.loc35_24.4 = load ptr, ptr %.loc35_24.2.temp, align 8, !dbg !49 +// CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr %.loc35_24.4), !dbg !50 +// CHECK:STDOUT: call void @"_COp.1341c5e44ed8ed9c:core.Destroy.Core"(ptr %.loc35_24.2.temp), !dbg !49 +// CHECK:STDOUT: ret void, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z16TakePtrWithThunkP1Ci.carbon_thunk._(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !51 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !51 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !52 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !52 // CHECK:STDOUT: call void @_Z16TakePtrWithThunkP1Ci(ptr noundef %1, i32 noundef 0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !54 { +// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !55 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk.(), !dbg !55 -// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !56 +// CHECK:STDOUT: %ReturnPtrWithThunk__carbon_thunk.call = call ptr @_Z18ReturnPtrWithThunki.carbon_thunk.(), !dbg !56 +// CHECK:STDOUT: ret ptr %ReturnPtrWithThunk__carbon_thunk.call, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -303,35 +304,35 @@ fn Convert() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.718daad32622d4f5"(ptr %self) #0 !dbg !57 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.9437b281f77355fe"(ptr %self), !dbg !63 -// CHECK:STDOUT: ret ptr %1, !dbg !64 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.718daad32622d4f5"(ptr %self) #0 !dbg !58 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.9437b281f77355fe"(ptr %self), !dbg !64 +// CHECK:STDOUT: ret ptr %1, !dbg !65 // CHECK:STDOUT: } // 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)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.9437b281f77355fe"(ptr %self) #0 !dbg !65 { -// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.9437b281f77355fe(ptr %self), !dbg !68 -// CHECK:STDOUT: ret ptr %1, !dbg !69 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.9437b281f77355fe"(ptr %self) #0 !dbg !66 { +// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.9437b281f77355fe(ptr %self), !dbg !69 +// CHECK:STDOUT: ret ptr %1, !dbg !70 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.9437b281f77355fe(ptr %value) #0 !dbg !70 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value), !dbg !73 -// CHECK:STDOUT: ret ptr %1, !dbg !74 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.9437b281f77355fe(ptr %value) #0 !dbg !71 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value), !dbg !74 +// CHECK:STDOUT: ret ptr %1, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self) #0 !dbg !75 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !78 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !78 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !78 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !79 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !80 -// CHECK:STDOUT: call void @"_COp.0eaa291c18f0461d:core.Destroy.Core"(ptr %1), !dbg !78 -// CHECK:STDOUT: ret ptr %2, !dbg !81 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self) #0 !dbg !76 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !79 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !79 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !79 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !80 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !81 +// CHECK:STDOUT: call void @"_COp.0eaa291c18f0461d:core.Destroy.Core"(ptr %1), !dbg !79 +// CHECK:STDOUT: ret ptr %2, !dbg !82 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z16TakePtrWithThunkP1Ci(ptr noundef, i32 noundef) #1 @@ -358,81 +359,82 @@ fn Convert() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !1, line: 14, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 14, column: 1, scope: !11) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "PassNonnullPtr", linkageName: "_CPassNonnullPtr.Main", scope: null, file: !1, line: 19, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !19) -// CHECK:STDOUT: !19 = !{!20} -// CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !18, type: !14) -// CHECK:STDOUT: !21 = !DILocation(line: 22, column: 15, scope: !18) -// CHECK:STDOUT: !22 = !DILocation(line: 22, column: 3, scope: !18) -// CHECK:STDOUT: !23 = !DILocation(line: 19, column: 1, scope: !18) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b66d38b36d1f26ac:core.Destroy.Core", scope: null, file: !1, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !25) -// CHECK:STDOUT: !25 = !{!26} -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !24, type: !14) -// CHECK:STDOUT: !27 = !DILocation(line: 22, column: 15, scope: !24) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0eaa291c18f0461d:core.Destroy.Core", scope: null, file: !1, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !29) -// CHECK:STDOUT: !29 = !{!30} -// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !28, type: !14) -// CHECK:STDOUT: !31 = !DILocation(line: 22, column: 15, scope: !28) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1341c5e44ed8ed9c:core.Destroy.Core", scope: null, file: !1, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) -// CHECK:STDOUT: !33 = !{!34} -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !14) -// CHECK:STDOUT: !35 = !DILocation(line: 22, column: 15, scope: !32) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !1, line: 25, type: !37, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !37 = !DISubroutineType(types: !38) -// CHECK:STDOUT: !38 = !{!14} -// CHECK:STDOUT: !39 = !DILocation(line: 26, column: 10, scope: !36) -// CHECK:STDOUT: !40 = !DILocation(line: 26, column: 3, scope: !36) -// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !1, line: 29, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !42) -// CHECK:STDOUT: !42 = !{!43} -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !14) -// CHECK:STDOUT: !44 = !DILocation(line: 29, column: 1, scope: !41) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !1, line: 34, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !46) -// CHECK:STDOUT: !46 = !{!47} -// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !14) -// CHECK:STDOUT: !48 = !DILocation(line: 35, column: 24, scope: !45) -// CHECK:STDOUT: !49 = !DILocation(line: 35, column: 3, scope: !45) -// CHECK:STDOUT: !50 = !DILocation(line: 34, column: 1, scope: !45) -// CHECK:STDOUT: !51 = !{!52, !52, i64 0} -// CHECK:STDOUT: !52 = !{!"p1 _ZTS1C", !53, i64 0} -// CHECK:STDOUT: !53 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !1, line: 38, type: !37, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !55 = !DILocation(line: 39, column: 10, scope: !54) -// CHECK:STDOUT: !56 = !DILocation(line: 39, column: 3, scope: !54) -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.718daad32622d4f5", scope: null, file: !58, line: 105, type: !59, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !61) -// CHECK:STDOUT: !58 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !59 = !DISubroutineType(types: !60) -// CHECK:STDOUT: !60 = !{!14, !14} -// CHECK:STDOUT: !61 = !{!62} -// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !57, type: !14) -// CHECK:STDOUT: !63 = !DILocation(line: 106, column: 12, scope: !57) -// CHECK:STDOUT: !64 = !DILocation(line: 106, column: 5, scope: !57) -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.9437b281f77355fe", scope: null, file: !58, line: 80, type: !59, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !66) -// CHECK:STDOUT: !66 = !{!67} -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !65, type: !14) -// CHECK:STDOUT: !68 = !DILocation(line: 81, column: 12, scope: !65) -// CHECK:STDOUT: !69 = !DILocation(line: 81, column: 5, scope: !65) -// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.9437b281f77355fe", scope: null, file: !58, line: 33, type: !59, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !71) -// CHECK:STDOUT: !71 = !{!72} -// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !70, type: !14) -// CHECK:STDOUT: !73 = !DILocation(line: 34, column: 12, scope: !70) -// CHECK:STDOUT: !74 = !DILocation(line: 34, column: 5, scope: !70) -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !58, line: 166, type: !59, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !76) -// CHECK:STDOUT: !76 = !{!77} -// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !75, type: !14) -// CHECK:STDOUT: !78 = !DILocation(line: 167, column: 14, scope: !75) -// CHECK:STDOUT: !79 = !DILocation(line: 169, column: 5, scope: !75) -// CHECK:STDOUT: !80 = !DILocation(line: 167, column: 18, scope: !75) -// CHECK:STDOUT: !81 = !DILocation(line: 170, column: 5, scope: !75) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !1, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 14, column: 1, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "PassNonnullPtr", linkageName: "_CPassNonnullPtr.Main", scope: null, file: !1, line: 19, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !20) +// CHECK:STDOUT: !20 = !{!21} +// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !19, type: !15) +// CHECK:STDOUT: !22 = !DILocation(line: 22, column: 15, scope: !19) +// CHECK:STDOUT: !23 = !DILocation(line: 22, column: 3, scope: !19) +// CHECK:STDOUT: !24 = !DILocation(line: 19, column: 1, scope: !19) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b66d38b36d1f26ac:core.Destroy.Core", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !15) +// CHECK:STDOUT: !28 = !DILocation(line: 22, column: 15, scope: !25) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0eaa291c18f0461d:core.Destroy.Core", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) +// CHECK:STDOUT: !30 = !{!31} +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !15) +// CHECK:STDOUT: !32 = !DILocation(line: 22, column: 15, scope: !29) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.1341c5e44ed8ed9c:core.Destroy.Core", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !15) +// CHECK:STDOUT: !36 = !DILocation(line: 22, column: 15, scope: !33) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !1, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !38 = !DISubroutineType(types: !39) +// CHECK:STDOUT: !39 = !{!15} +// CHECK:STDOUT: !40 = !DILocation(line: 26, column: 10, scope: !37) +// CHECK:STDOUT: !41 = !DILocation(line: 26, column: 3, scope: !37) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !1, line: 29, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43) +// CHECK:STDOUT: !43 = !{!44} +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !42, type: !15) +// CHECK:STDOUT: !45 = !DILocation(line: 29, column: 1, scope: !42) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !1, line: 34, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !47) +// CHECK:STDOUT: !47 = !{!48} +// CHECK:STDOUT: !48 = !DILocalVariable(arg: 1, scope: !46, type: !15) +// CHECK:STDOUT: !49 = !DILocation(line: 35, column: 24, scope: !46) +// CHECK:STDOUT: !50 = !DILocation(line: 35, column: 3, scope: !46) +// CHECK:STDOUT: !51 = !DILocation(line: 34, column: 1, scope: !46) +// CHECK:STDOUT: !52 = !{!53, !53, i64 0} +// CHECK:STDOUT: !53 = !{!"p1 _ZTS1C", !54, i64 0} +// CHECK:STDOUT: !54 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !1, line: 38, type: !38, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !56 = !DILocation(line: 39, column: 10, scope: !55) +// CHECK:STDOUT: !57 = !DILocation(line: 39, column: 3, scope: !55) +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.718daad32622d4f5", scope: null, file: !59, line: 105, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !62) +// CHECK:STDOUT: !59 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !60 = !DISubroutineType(types: !61) +// CHECK:STDOUT: !61 = !{!15, !15} +// CHECK:STDOUT: !62 = !{!63} +// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !58, type: !15) +// CHECK:STDOUT: !64 = !DILocation(line: 106, column: 12, scope: !58) +// CHECK:STDOUT: !65 = !DILocation(line: 106, column: 5, scope: !58) +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.9437b281f77355fe", scope: null, file: !59, line: 80, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !67) +// CHECK:STDOUT: !67 = !{!68} +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !66, type: !15) +// CHECK:STDOUT: !69 = !DILocation(line: 81, column: 12, scope: !66) +// CHECK:STDOUT: !70 = !DILocation(line: 81, column: 5, scope: !66) +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.9437b281f77355fe", scope: null, file: !59, line: 33, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !72) +// CHECK:STDOUT: !72 = !{!73} +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !71, type: !15) +// CHECK:STDOUT: !74 = !DILocation(line: 34, column: 12, scope: !71) +// CHECK:STDOUT: !75 = !DILocation(line: 34, column: 5, scope: !71) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !59, line: 166, type: !60, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !77) +// CHECK:STDOUT: !77 = !{!78} +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !76, type: !15) +// CHECK:STDOUT: !79 = !DILocation(line: 167, column: 14, scope: !76) +// CHECK:STDOUT: !80 = !DILocation(line: 169, column: 5, scope: !76) +// CHECK:STDOUT: !81 = !DILocation(line: 167, column: 18, scope: !76) +// CHECK:STDOUT: !82 = !DILocation(line: 170, column: 5, scope: !76) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'add_const.carbon' @@ -441,22 +443,22 @@ fn Convert() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvert.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CConvert.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_21.1.temp = alloca ptr, align 8, !dbg !14 -// CHECK:STDOUT: %.loc9_21.5.temp = alloca ptr, align 8, !dbg !14 -// CHECK:STDOUT: %make.call = call ptr @_Z4makev(), !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.1.temp), !dbg !14 -// CHECK:STDOUT: store ptr %make.call, ptr %.loc9_21.1.temp, align 8, !dbg !14 -// CHECK:STDOUT: %.loc9_21.3 = load ptr, ptr %.loc9_21.1.temp, align 8, !dbg !14 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.4ac926a9bb296667"(ptr %.loc9_21.3), !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.5.temp), !dbg !14 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc9_21.5.temp, align 8, !dbg !14 -// CHECK:STDOUT: %.loc9_21.7 = load ptr, ptr %.loc9_21.5.temp, align 8, !dbg !14 -// CHECK:STDOUT: call void @_Z4takePK1C(ptr %.loc9_21.7), !dbg !15 -// CHECK:STDOUT: call void @"_COp.5a309bcb12d98030:core.Destroy.Core"(ptr %.loc9_21.5.temp), !dbg !14 -// CHECK:STDOUT: call void @"_COp.50147b96cc245a5c:core.Destroy.Core"(ptr %.loc9_21.1.temp), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !16 +// CHECK:STDOUT: %.loc9_21.1.temp = alloca ptr, align 8, !dbg !15 +// CHECK:STDOUT: %.loc9_21.5.temp = alloca ptr, align 8, !dbg !15 +// CHECK:STDOUT: %make.call = call ptr @_Z4makev(), !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.1.temp), !dbg !15 +// CHECK:STDOUT: store ptr %make.call, ptr %.loc9_21.1.temp, align 8, !dbg !15 +// CHECK:STDOUT: %.loc9_21.3 = load ptr, ptr %.loc9_21.1.temp, align 8, !dbg !15 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.4ac926a9bb296667"(ptr %.loc9_21.3), !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_21.5.temp), !dbg !15 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc9_21.5.temp, align 8, !dbg !15 +// CHECK:STDOUT: %.loc9_21.7 = load ptr, ptr %.loc9_21.5.temp, align 8, !dbg !15 +// CHECK:STDOUT: call void @_Z4takePK1C(ptr %.loc9_21.7), !dbg !16 +// CHECK:STDOUT: call void @"_COp.5a309bcb12d98030:core.Destroy.Core"(ptr %.loc9_21.5.temp), !dbg !15 +// CHECK:STDOUT: call void @"_COp.50147b96cc245a5c:core.Destroy.Core"(ptr %.loc9_21.1.temp), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z4makev() #1 @@ -464,117 +466,117 @@ fn Convert() { // CHECK:STDOUT: declare void @_Z4takePK1C(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.4a199b7f45343bf7:core.Destroy.Core"(ptr %self) #0 !dbg !17 { +// CHECK:STDOUT: define weak_odr void @"_COp.4a199b7f45343bf7:core.Destroy.Core"(ptr %self) #0 !dbg !18 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.95d54adfec6e2c8e:core.Destroy.Core"(ptr %self) #0 !dbg !24 { +// CHECK:STDOUT: define weak_odr void @"_COp.95d54adfec6e2c8e:core.Destroy.Core"(ptr %self) #0 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5a309bcb12d98030:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// CHECK:STDOUT: define weak_odr void @"_COp.5a309bcb12d98030:core.Destroy.Core"(ptr %self) #0 !dbg !29 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b66d38b36d1f26ac:core.Destroy.Core"(ptr %self) #0 !dbg !32 { +// CHECK:STDOUT: define weak_odr void @"_COp.b66d38b36d1f26ac:core.Destroy.Core"(ptr %self) #0 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0eaa291c18f0461d:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// CHECK:STDOUT: define weak_odr void @"_COp.0eaa291c18f0461d:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !39 +// CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.50147b96cc245a5c:core.Destroy.Core"(ptr %self) #0 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_COp.50147b96cc245a5c:core.Destroy.Core"(ptr %self) #0 !dbg !41 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // 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)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.4ac926a9bb296667"(ptr %self) #0 !dbg !44 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.cdbe4154b421df5e"(ptr %self), !dbg !50 -// CHECK:STDOUT: ret ptr %1, !dbg !51 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.4ac926a9bb296667"(ptr %self) #0 !dbg !45 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.cdbe4154b421df5e"(ptr %self), !dbg !51 +// CHECK:STDOUT: ret ptr %1, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.cdbe4154b421df5e"(ptr %self) #0 !dbg !52 { -// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !55 -// CHECK:STDOUT: %temp1 = alloca ptr, align 8, !dbg !55 -// CHECK:STDOUT: %1 = call i1 @_CHasValue.Optional.Core.8a123cba93150295(ptr %self), !dbg !56 -// CHECK:STDOUT: br i1 %1, label %2, label %7, !dbg !57 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.cdbe4154b421df5e"(ptr %self) #0 !dbg !53 { +// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !56 +// CHECK:STDOUT: %temp1 = alloca ptr, align 8, !dbg !56 +// CHECK:STDOUT: %1 = call i1 @_CHasValue.Optional.Core.8a123cba93150295(ptr %self), !dbg !57 +// CHECK:STDOUT: br i1 %1, label %2, label %7, !dbg !58 // CHECK:STDOUT: // CHECK:STDOUT: 2: ; preds = %0 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !55 -// CHECK:STDOUT: %3 = call ptr @_CGet.Optional.Core.8a123cba93150295(ptr %self), !dbg !55 -// CHECK:STDOUT: store ptr %3, ptr %temp, align 8, !dbg !55 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !55 -// CHECK:STDOUT: %4 = load ptr, ptr %temp, align 8, !dbg !55 -// CHECK:STDOUT: store ptr %4, ptr %temp1, align 8, !dbg !55 -// CHECK:STDOUT: %5 = load ptr, ptr %temp1, align 8, !dbg !55 -// CHECK:STDOUT: %6 = call ptr @_CSome.Optional.Core.0a3165baf8bbb6d3(ptr %5), !dbg !58 -// CHECK:STDOUT: ret ptr %6, !dbg !59 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !56 +// CHECK:STDOUT: %3 = call ptr @_CGet.Optional.Core.8a123cba93150295(ptr %self), !dbg !56 +// CHECK:STDOUT: store ptr %3, ptr %temp, align 8, !dbg !56 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !56 +// CHECK:STDOUT: %4 = load ptr, ptr %temp, align 8, !dbg !56 +// CHECK:STDOUT: store ptr %4, ptr %temp1, align 8, !dbg !56 +// CHECK:STDOUT: %5 = load ptr, ptr %temp1, align 8, !dbg !56 +// CHECK:STDOUT: %6 = call ptr @_CSome.Optional.Core.0a3165baf8bbb6d3(ptr %5), !dbg !59 +// CHECK:STDOUT: ret ptr %6, !dbg !60 // CHECK:STDOUT: // CHECK:STDOUT: 7: ; preds = %0 -// CHECK:STDOUT: %8 = call ptr @_CNone.Optional.Core.0a3165baf8bbb6d3(), !dbg !60 -// CHECK:STDOUT: ret ptr %8, !dbg !61 +// CHECK:STDOUT: %8 = call ptr @_CNone.Optional.Core.0a3165baf8bbb6d3(), !dbg !61 +// CHECK:STDOUT: ret ptr %8, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.8a123cba93150295(ptr %self) #0 !dbg !62 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self), !dbg !65 -// CHECK:STDOUT: ret i1 %1, !dbg !66 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.8a123cba93150295(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self), !dbg !66 +// CHECK:STDOUT: ret i1 %1, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.8a123cba93150295(ptr %self) #0 !dbg !67 { -// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self), !dbg !70 -// CHECK:STDOUT: ret ptr %1, !dbg !71 +// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.8a123cba93150295(ptr %self) #0 !dbg !68 { +// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %self), !dbg !71 +// CHECK:STDOUT: ret ptr %1, !dbg !72 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.0a3165baf8bbb6d3(ptr %value) #0 !dbg !72 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539"(ptr %value), !dbg !75 -// CHECK:STDOUT: ret ptr %1, !dbg !76 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.0a3165baf8bbb6d3(ptr %value) #0 !dbg !73 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539"(ptr %value), !dbg !76 +// CHECK:STDOUT: ret ptr %1, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.0a3165baf8bbb6d3() #0 !dbg !77 { -// CHECK:STDOUT: ret ptr null, !dbg !80 +// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.0a3165baf8bbb6d3() #0 !dbg !78 { +// CHECK:STDOUT: ret ptr null, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value) #0 !dbg !81 { -// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !84 -// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !85 -// CHECK:STDOUT: ret i1 %2, !dbg !86 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value) #0 !dbg !82 { +// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !85 +// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !86 +// CHECK:STDOUT: ret i1 %2, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value) #0 !dbg !87 { -// CHECK:STDOUT: ret ptr %value, !dbg !90 +// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e"(ptr %value) #0 !dbg !88 { +// CHECK:STDOUT: ret ptr %value, !dbg !91 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539"(ptr %self) #0 !dbg !91 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !94 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !94 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !94 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !95 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !96 -// CHECK:STDOUT: call void @"_COp.95d54adfec6e2c8e:core.Destroy.Core"(ptr %1), !dbg !94 -// CHECK:STDOUT: ret ptr %2, !dbg !97 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539"(ptr %self) #0 !dbg !92 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !95 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !95 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !95 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !96 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !97 +// CHECK:STDOUT: call void @"_COp.95d54adfec6e2c8e:core.Destroy.Core"(ptr %1), !dbg !95 +// CHECK:STDOUT: ret ptr %2, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -595,95 +597,96 @@ fn Convert() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !1, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 9, column: 12, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 1, scope: !11) -// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4a199b7f45343bf7:core.Destroy.Core", scope: null, file: !1, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) -// CHECK:STDOUT: !18 = !DISubroutineType(types: !19) -// CHECK:STDOUT: !19 = !{null, !20} -// CHECK:STDOUT: !20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !21 = !{!22} -// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !17, type: !20) -// CHECK:STDOUT: !23 = !DILocation(line: 9, column: 12, scope: !17) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.95d54adfec6e2c8e:core.Destroy.Core", scope: null, file: !1, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !25) -// CHECK:STDOUT: !25 = !{!26} -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !24, type: !20) -// CHECK:STDOUT: !27 = !DILocation(line: 9, column: 12, scope: !24) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a309bcb12d98030:core.Destroy.Core", scope: null, file: !1, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !29) -// CHECK:STDOUT: !29 = !{!30} -// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !28, type: !20) -// CHECK:STDOUT: !31 = !DILocation(line: 9, column: 12, scope: !28) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b66d38b36d1f26ac:core.Destroy.Core", scope: null, file: !1, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) -// CHECK:STDOUT: !33 = !{!34} -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !20) -// CHECK:STDOUT: !35 = !DILocation(line: 9, column: 12, scope: !32) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0eaa291c18f0461d:core.Destroy.Core", scope: null, file: !1, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !37) -// CHECK:STDOUT: !37 = !{!38} -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !20) -// CHECK:STDOUT: !39 = !DILocation(line: 9, column: 12, scope: !36) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "Op", linkageName: "_COp.50147b96cc245a5c:core.Destroy.Core", scope: null, file: !1, line: 9, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !41) -// CHECK:STDOUT: !41 = !{!42} -// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !40, type: !20) -// CHECK:STDOUT: !43 = !DILocation(line: 9, column: 12, scope: !40) -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.4ac926a9bb296667", scope: null, file: !45, line: 105, type: !46, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !48) -// CHECK:STDOUT: !45 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !46 = !DISubroutineType(types: !47) -// CHECK:STDOUT: !47 = !{!20, !20} -// CHECK:STDOUT: !48 = !{!49} -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !44, type: !20) -// CHECK:STDOUT: !50 = !DILocation(line: 106, column: 12, scope: !44) -// CHECK:STDOUT: !51 = !DILocation(line: 106, column: 5, scope: !44) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.cdbe4154b421df5e", scope: null, file: !45, line: 95, type: !46, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !53) -// CHECK:STDOUT: !53 = !{!54} -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !52, type: !20) -// CHECK:STDOUT: !55 = !DILocation(line: 97, column: 31, scope: !52) -// CHECK:STDOUT: !56 = !DILocation(line: 96, column: 9, scope: !52) -// CHECK:STDOUT: !57 = !DILocation(line: 96, column: 8, scope: !52) -// CHECK:STDOUT: !58 = !DILocation(line: 97, column: 14, scope: !52) -// CHECK:STDOUT: !59 = !DILocation(line: 97, column: 7, scope: !52) -// CHECK:STDOUT: !60 = !DILocation(line: 99, column: 12, scope: !52) -// CHECK:STDOUT: !61 = !DILocation(line: 99, column: 5, scope: !52) -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.8a123cba93150295", scope: null, file: !45, line: 36, type: !46, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !63) -// CHECK:STDOUT: !63 = !{!64} -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !62, type: !20) -// CHECK:STDOUT: !65 = !DILocation(line: 37, column: 12, scope: !62) -// CHECK:STDOUT: !66 = !DILocation(line: 37, column: 5, scope: !62) -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.8a123cba93150295", scope: null, file: !45, line: 39, type: !46, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !68) -// CHECK:STDOUT: !68 = !{!69} -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !67, type: !20) -// CHECK:STDOUT: !70 = !DILocation(line: 40, column: 12, scope: !67) -// CHECK:STDOUT: !71 = !DILocation(line: 40, column: 5, scope: !67) -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.0a3165baf8bbb6d3", scope: null, file: !45, line: 33, type: !46, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !73) -// CHECK:STDOUT: !73 = !{!74} -// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !72, type: !20) -// CHECK:STDOUT: !75 = !DILocation(line: 34, column: 12, scope: !72) -// CHECK:STDOUT: !76 = !DILocation(line: 34, column: 5, scope: !72) -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.0a3165baf8bbb6d3", scope: null, file: !45, line: 30, type: !78, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !78 = !DISubroutineType(types: !79) -// CHECK:STDOUT: !79 = !{!20} -// CHECK:STDOUT: !80 = !DILocation(line: 31, column: 5, scope: !77) -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !45, line: 172, type: !46, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !82) -// CHECK:STDOUT: !82 = !{!83} -// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !81, type: !20) -// CHECK:STDOUT: !84 = !DILocation(line: 173, column: 16, scope: !81) -// CHECK:STDOUT: !85 = !DILocation(line: 173, column: 12, scope: !81) -// CHECK:STDOUT: !86 = !DILocation(line: 173, column: 5, scope: !81) -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !45, line: 175, type: !46, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !88) -// CHECK:STDOUT: !88 = !{!89} -// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !87, type: !20) -// CHECK:STDOUT: !90 = !DILocation(line: 176, column: 5, scope: !87) -// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539", scope: null, file: !45, line: 166, type: !46, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !92) -// CHECK:STDOUT: !92 = !{!93} -// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !91, type: !20) -// CHECK:STDOUT: !94 = !DILocation(line: 167, column: 14, scope: !91) -// CHECK:STDOUT: !95 = !DILocation(line: 169, column: 5, scope: !91) -// CHECK:STDOUT: !96 = !DILocation(line: 167, column: 18, scope: !91) -// CHECK:STDOUT: !97 = !DILocation(line: 170, column: 5, scope: !91) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !1, line: 8, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 9, column: 12, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 8, column: 1, scope: !12) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.4a199b7f45343bf7:core.Destroy.Core", scope: null, file: !1, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{null, !21} +// CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !18, type: !21) +// CHECK:STDOUT: !24 = !DILocation(line: 9, column: 12, scope: !18) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.95d54adfec6e2c8e:core.Destroy.Core", scope: null, file: !1, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !21) +// CHECK:STDOUT: !28 = !DILocation(line: 9, column: 12, scope: !25) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a309bcb12d98030:core.Destroy.Core", scope: null, file: !1, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) +// CHECK:STDOUT: !30 = !{!31} +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !21) +// CHECK:STDOUT: !32 = !DILocation(line: 9, column: 12, scope: !29) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b66d38b36d1f26ac:core.Destroy.Core", scope: null, file: !1, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !21) +// CHECK:STDOUT: !36 = !DILocation(line: 9, column: 12, scope: !33) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0eaa291c18f0461d:core.Destroy.Core", scope: null, file: !1, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !38) +// CHECK:STDOUT: !38 = !{!39} +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 1, scope: !37, type: !21) +// CHECK:STDOUT: !40 = !DILocation(line: 9, column: 12, scope: !37) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "Op", linkageName: "_COp.50147b96cc245a5c:core.Destroy.Core", scope: null, file: !1, line: 9, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !42) +// CHECK:STDOUT: !42 = !{!43} +// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !41, type: !21) +// CHECK:STDOUT: !44 = !DILocation(line: 9, column: 12, scope: !41) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.4ac926a9bb296667", scope: null, file: !46, line: 105, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !49) +// CHECK:STDOUT: !46 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !47 = !DISubroutineType(types: !48) +// CHECK:STDOUT: !48 = !{!21, !21} +// CHECK:STDOUT: !49 = !{!50} +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !45, type: !21) +// CHECK:STDOUT: !51 = !DILocation(line: 106, column: 12, scope: !45) +// CHECK:STDOUT: !52 = !DILocation(line: 106, column: 5, scope: !45) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Optional.c661605f12aa337a.Core:OptionalAs.1dac4564233fecd1.Core.cdbe4154b421df5e", scope: null, file: !46, line: 95, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !54) +// CHECK:STDOUT: !54 = !{!55} +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !21) +// CHECK:STDOUT: !56 = !DILocation(line: 97, column: 31, scope: !53) +// CHECK:STDOUT: !57 = !DILocation(line: 96, column: 9, scope: !53) +// CHECK:STDOUT: !58 = !DILocation(line: 96, column: 8, scope: !53) +// CHECK:STDOUT: !59 = !DILocation(line: 97, column: 14, scope: !53) +// CHECK:STDOUT: !60 = !DILocation(line: 97, column: 7, scope: !53) +// CHECK:STDOUT: !61 = !DILocation(line: 99, column: 12, scope: !53) +// CHECK:STDOUT: !62 = !DILocation(line: 99, column: 5, scope: !53) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.8a123cba93150295", scope: null, file: !46, line: 36, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !64) +// CHECK:STDOUT: !64 = !{!65} +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !63, type: !21) +// CHECK:STDOUT: !66 = !DILocation(line: 37, column: 12, scope: !63) +// CHECK:STDOUT: !67 = !DILocation(line: 37, column: 5, scope: !63) +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.8a123cba93150295", scope: null, file: !46, line: 39, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !69) +// CHECK:STDOUT: !69 = !{!70} +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !68, type: !21) +// CHECK:STDOUT: !71 = !DILocation(line: 40, column: 12, scope: !68) +// CHECK:STDOUT: !72 = !DILocation(line: 40, column: 5, scope: !68) +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.0a3165baf8bbb6d3", scope: null, file: !46, line: 33, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !74) +// CHECK:STDOUT: !74 = !{!75} +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !73, type: !21) +// CHECK:STDOUT: !76 = !DILocation(line: 34, column: 12, scope: !73) +// CHECK:STDOUT: !77 = !DILocation(line: 34, column: 5, scope: !73) +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.0a3165baf8bbb6d3", scope: null, file: !46, line: 30, type: !79, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !79 = !DISubroutineType(types: !80) +// CHECK:STDOUT: !80 = !{!21} +// CHECK:STDOUT: !81 = !DILocation(line: 31, column: 5, scope: !78) +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !46, line: 172, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !83) +// CHECK:STDOUT: !83 = !{!84} +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !82, type: !21) +// CHECK:STDOUT: !85 = !DILocation(line: 173, column: 16, scope: !82) +// CHECK:STDOUT: !86 = !DILocation(line: 173, column: 12, scope: !82) +// CHECK:STDOUT: !87 = !DILocation(line: 173, column: 5, scope: !82) +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.fc8b3e0dc71c345e", scope: null, file: !46, line: 175, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !89) +// CHECK:STDOUT: !89 = !{!90} +// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !88, type: !21) +// CHECK:STDOUT: !91 = !DILocation(line: 176, column: 5, scope: !88) +// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8753681fdb639539", scope: null, file: !46, line: 166, type: !47, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !93) +// CHECK:STDOUT: !93 = !{!94} +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !92, type: !21) +// CHECK:STDOUT: !95 = !DILocation(line: 167, column: 14, scope: !92) +// CHECK:STDOUT: !96 = !DILocation(line: 169, column: 5, scope: !92) +// CHECK:STDOUT: !97 = !DILocation(line: 167, column: 18, scope: !92) +// CHECK:STDOUT: !98 = !DILocation(line: 170, column: 5, scope: !92) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/reference.carbon b/toolchain/lower/testdata/interop/cpp/reference.carbon index f54aed9d82ffb..46552a677b0fb 100644 --- a/toolchain/lower/testdata/interop/cpp/reference.carbon +++ b/toolchain/lower/testdata/interop/cpp/reference.carbon @@ -137,50 +137,50 @@ fn GetRefs() { // CHECK:STDOUT: @C.val.loc19_20 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassRefs.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CPassRefs.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !14 -// CHECK:STDOUT: %_.var.1 = alloca {}, align 1, !dbg !15 -// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !16 -// CHECK:STDOUT: %_.var.2 = alloca i32, align 4, !dbg !17 -// CHECK:STDOUT: %.loc25_23.2.temp = alloca i32, align 4, !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !14 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %c.var), !dbg !14 -// CHECK:STDOUT: call void @_Z8TakeCRefR1C(ptr %c.var), !dbg !19 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.1), !dbg !15 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.1, ptr align 1 @C.val.loc19_20, i64 0, i1 false), !dbg !15 -// CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk.v(ptr %_.var.1), !dbg !20 -// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C.carbon_thunk._(ptr %c.var), !dbg !21 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !16 -// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !16 -// CHECK:STDOUT: call void @_Z10TakeIntRefRi(ptr %n.var), !dbg !22 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.2), !dbg !17 -// CHECK:STDOUT: store i32 42, ptr %_.var.2, align 4, !dbg !17 -// CHECK:STDOUT: call void @_Z11TakeIntRRefOi.carbon_thunk.v(ptr %_.var.2), !dbg !23 -// CHECK:STDOUT: %.loc25_23.1 = load i32, ptr %n.var, align 4, !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_23.2.temp), !dbg !18 -// CHECK:STDOUT: store i32 %.loc25_23.1, ptr %.loc25_23.2.temp, align 4, !dbg !18 -// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi.carbon_thunk._(ptr %.loc25_23.2.temp), !dbg !24 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc25_23.2.temp), !dbg !18 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var.2), !dbg !17 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %n.var), !dbg !16 -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !15 +// CHECK:STDOUT: %_.var.1 = alloca {}, align 1, !dbg !16 +// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !17 +// CHECK:STDOUT: %_.var.2 = alloca i32, align 4, !dbg !18 +// CHECK:STDOUT: %.loc25_23.2.temp = alloca i32, align 4, !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !15 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %c.var), !dbg !15 +// CHECK:STDOUT: call void @_Z8TakeCRefR1C(ptr %c.var), !dbg !20 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.1), !dbg !16 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.1, ptr align 1 @C.val.loc19_20, i64 0, i1 false), !dbg !16 +// CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk.v(ptr %_.var.1), !dbg !21 +// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C.carbon_thunk._(ptr %c.var), !dbg !22 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !17 +// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !17 +// CHECK:STDOUT: call void @_Z10TakeIntRefRi(ptr %n.var), !dbg !23 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.2), !dbg !18 +// CHECK:STDOUT: store i32 42, ptr %_.var.2, align 4, !dbg !18 +// CHECK:STDOUT: call void @_Z11TakeIntRRefOi.carbon_thunk.v(ptr %_.var.2), !dbg !24 +// CHECK:STDOUT: %.loc25_23.1 = load i32, ptr %n.var, align 4, !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_23.2.temp), !dbg !19 +// CHECK:STDOUT: store i32 %.loc25_23.1, ptr %.loc25_23.2.temp, align 4, !dbg !19 +// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi.carbon_thunk._(ptr %.loc25_23.2.temp), !dbg !25 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc25_23.2.temp), !dbg !19 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var.2), !dbg !18 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %n.var), !dbg !17 +// CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !26 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !26 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !27 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !27 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret({}) %return) #2 !dbg !29 { +// CHECK:STDOUT: define void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret({}) %return) #2 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !33 -// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !34 +// CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z8TakeCRefR1C(ptr noundef nonnull align 1 dereferenceable(1)) #3 @@ -189,8 +189,8 @@ fn GetRefs() { // CHECK:STDOUT: define internal void @_Z9TakeCRRefO1C.carbon_thunk.v(ptr noundef %0) #4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !26 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !26 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !27 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !27 // CHECK:STDOUT: call void @_Z9TakeCRRefO1C(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -199,8 +199,8 @@ fn GetRefs() { // CHECK:STDOUT: define internal void @_Z13TakeConstCRefRK1C.carbon_thunk._(ptr noundef %0) #4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !26 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !26 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !27 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !27 // CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -211,8 +211,8 @@ fn GetRefs() { // CHECK:STDOUT: define internal void @_Z11TakeIntRRefOi.carbon_thunk.v(ptr noundef %0) #4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !34 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !34 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !35 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !35 // CHECK:STDOUT: call void @_Z11TakeIntRRefOi(ptr noundef nonnull align 4 dereferenceable(4) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -221,25 +221,25 @@ fn GetRefs() { // CHECK:STDOUT: define internal void @_Z15TakeConstIntRefRKi.carbon_thunk._(ptr noundef %0) #4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !34 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !34 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !35 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !35 // CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi(ptr noundef nonnull align 4 dereferenceable(4) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !36 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // 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)) #5 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !43 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !45 -// CHECK:STDOUT: ret void, !dbg !46 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !44 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !46 +// CHECK:STDOUT: ret void, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -275,46 +275,47 @@ fn GetRefs() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !1, line: 16, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 17, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 19, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 22, column: 3, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 23, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 25, column: 23, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 18, column: 3, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 19, column: 3, scope: !11) -// CHECK:STDOUT: !21 = !DILocation(line: 20, column: 3, scope: !11) -// CHECK:STDOUT: !22 = !DILocation(line: 23, column: 3, scope: !11) -// CHECK:STDOUT: !23 = !DILocation(line: 24, column: 3, scope: !11) -// CHECK:STDOUT: !24 = !DILocation(line: 25, column: 3, scope: !11) -// CHECK:STDOUT: !25 = !DILocation(line: 16, column: 1, scope: !11) -// CHECK:STDOUT: !26 = !{!27, !27, i64 0} -// CHECK:STDOUT: !27 = !{!"p1 _ZTS1C", !28, i64 0} -// CHECK:STDOUT: !28 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !1, line: 5, type: !30, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) -// CHECK:STDOUT: !31 = !{!32} -// CHECK:STDOUT: !32 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !33 = !DILocation(line: 5, column: 7, scope: !29) -// CHECK:STDOUT: !34 = !{!35, !35, i64 0} -// CHECK:STDOUT: !35 = !{!"p1 int", !28, i64 0} -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 25, type: !37, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !40) -// CHECK:STDOUT: !37 = !DISubroutineType(types: !38) -// CHECK:STDOUT: !38 = !{null, !39} -// CHECK:STDOUT: !39 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !40 = !{!41} -// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !36, type: !39) -// CHECK:STDOUT: !42 = !DILocation(line: 25, column: 23, scope: !36) -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !44, line: 9, type: !30, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !44 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") -// CHECK:STDOUT: !45 = !DILocation(line: 9, column: 28, scope: !43) -// CHECK:STDOUT: !46 = !DILocation(line: 9, column: 21, scope: !43) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !1, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 17, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 8, column: 19, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 22, column: 3, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 23, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 25, column: 23, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 18, column: 3, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 19, column: 3, scope: !12) +// CHECK:STDOUT: !22 = !DILocation(line: 20, column: 3, scope: !12) +// CHECK:STDOUT: !23 = !DILocation(line: 23, column: 3, scope: !12) +// CHECK:STDOUT: !24 = !DILocation(line: 24, column: 3, scope: !12) +// CHECK:STDOUT: !25 = !DILocation(line: 25, column: 3, scope: !12) +// CHECK:STDOUT: !26 = !DILocation(line: 16, column: 1, scope: !12) +// CHECK:STDOUT: !27 = !{!28, !28, i64 0} +// CHECK:STDOUT: !28 = !{!"p1 _ZTS1C", !29, i64 0} +// CHECK:STDOUT: !29 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !1, line: 5, type: !31, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !34 = !DILocation(line: 5, column: 7, scope: !30) +// CHECK:STDOUT: !35 = !{!36, !36, i64 0} +// CHECK:STDOUT: !36 = !{!"p1 int", !29, i64 0} +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 25, type: !38, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !41) +// CHECK:STDOUT: !38 = !DISubroutineType(types: !39) +// CHECK:STDOUT: !39 = !{null, !40} +// CHECK:STDOUT: !40 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !41 = !{!42} +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !37, type: !40) +// CHECK:STDOUT: !43 = !DILocation(line: 25, column: 23, scope: !37) +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !45, line: 9, type: !31, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !45 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") +// CHECK:STDOUT: !46 = !DILocation(line: 9, column: 28, scope: !44) +// CHECK:STDOUT: !47 = !DILocation(line: 9, column: 21, scope: !44) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'pass_references_via_thunk.carbon' @@ -328,49 +329,49 @@ fn GetRefs() { // CHECK:STDOUT: @C.val.loc20_20.3 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassRefs.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CPassRefs.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !14 -// CHECK:STDOUT: %.loc20_18.2.temp = alloca {}, align 1, !dbg !15 -// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !16 -// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !17 -// CHECK:STDOUT: %.loc26_23.2.temp = alloca i32, align 4, !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !14 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %c.var), !dbg !14 -// CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk.r(ptr %c.var), !dbg !19 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_18.2.temp), !dbg !15 -// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk._(ptr @C.val.loc20_20.3), !dbg !20 -// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk._(ptr %c.var), !dbg !21 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !16 -// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !16 -// CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk.r(ptr %n.var), !dbg !22 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !17 -// CHECK:STDOUT: store i32 42, ptr %_.var, align 4, !dbg !17 -// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk.v(ptr %_.var), !dbg !23 -// CHECK:STDOUT: %.loc26_23.1 = load i32, ptr %n.var, align 4, !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_23.2.temp), !dbg !18 -// CHECK:STDOUT: store i32 %.loc26_23.1, ptr %.loc26_23.2.temp, align 4, !dbg !18 -// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk._(ptr %.loc26_23.2.temp), !dbg !24 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc26_23.2.temp), !dbg !18 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var), !dbg !17 -// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %n.var), !dbg !16 -// CHECK:STDOUT: ret void, !dbg !25 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !15 +// CHECK:STDOUT: %.loc20_18.2.temp = alloca {}, align 1, !dbg !16 +// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !17 +// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !18 +// CHECK:STDOUT: %.loc26_23.2.temp = alloca i32, align 4, !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !15 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %c.var), !dbg !15 +// CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk.r(ptr %c.var), !dbg !20 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_18.2.temp), !dbg !16 +// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk._(ptr @C.val.loc20_20.3), !dbg !21 +// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk._(ptr %c.var), !dbg !22 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !17 +// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !17 +// CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk.r(ptr %n.var), !dbg !23 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !18 +// CHECK:STDOUT: store i32 42, ptr %_.var, align 4, !dbg !18 +// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk.v(ptr %_.var), !dbg !24 +// CHECK:STDOUT: %.loc26_23.1 = load i32, ptr %n.var, align 4, !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_23.2.temp), !dbg !19 +// CHECK:STDOUT: store i32 %.loc26_23.1, ptr %.loc26_23.2.temp, align 4, !dbg !19 +// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk._(ptr %.loc26_23.2.temp), !dbg !25 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %.loc26_23.2.temp), !dbg !19 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %_.var), !dbg !18 +// CHECK:STDOUT: call void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %n.var), !dbg !17 +// CHECK:STDOUT: ret void, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN1CC1Ev.carbon_thunk.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !26 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !26 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !27 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !27 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret({}) %return) #2 !dbg !29 { +// CHECK:STDOUT: define void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret({}) %return) #2 !dbg !30 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !33 -// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !34 +// CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -378,8 +379,8 @@ fn GetRefs() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !26 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !26, !nonnull !34 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !27 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !27, !nonnull !35 // CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -389,8 +390,8 @@ fn GetRefs() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !26 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !26 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !27 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !27 // CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -400,8 +401,8 @@ fn GetRefs() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !26 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !26 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !27 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !27 // CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -411,8 +412,8 @@ fn GetRefs() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !35 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !35, !nonnull !34, !align !37 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !36 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !36, !nonnull !35, !align !38 // CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk(ptr noundef nonnull align 4 dereferenceable(4) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -422,8 +423,8 @@ fn GetRefs() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !35 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !35 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !36 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !36 // CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk(ptr noundef nonnull align 4 dereferenceable(4) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -433,25 +434,25 @@ fn GetRefs() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.ForceThunk, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !35 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !35 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !36 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !36 // CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk(ptr noundef nonnull align 4 dereferenceable(4) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !38 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !39 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: ret void, !dbg !45 // CHECK:STDOUT: } // 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)) #4 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !45 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !47 -// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !46 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z8TakeCRefR1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1)) #5 @@ -488,48 +489,49 @@ fn GetRefs() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !1, line: 17, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 18, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 20, column: 17, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 23, column: 3, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 13, column: 23, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 26, column: 23, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 19, column: 3, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 20, column: 3, scope: !11) -// CHECK:STDOUT: !21 = !DILocation(line: 21, column: 3, scope: !11) -// CHECK:STDOUT: !22 = !DILocation(line: 24, column: 3, scope: !11) -// CHECK:STDOUT: !23 = !DILocation(line: 25, column: 3, scope: !11) -// CHECK:STDOUT: !24 = !DILocation(line: 26, column: 3, scope: !11) -// CHECK:STDOUT: !25 = !DILocation(line: 17, column: 1, scope: !11) -// CHECK:STDOUT: !26 = !{!27, !27, i64 0} -// CHECK:STDOUT: !27 = !{!"p1 _ZTS1C", !28, i64 0} -// CHECK:STDOUT: !28 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !1, line: 5, type: !30, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !30 = !DISubroutineType(types: !31) -// CHECK:STDOUT: !31 = !{!32} -// CHECK:STDOUT: !32 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !33 = !DILocation(line: 5, column: 7, scope: !29) -// CHECK:STDOUT: !34 = !{} -// CHECK:STDOUT: !35 = !{!36, !36, i64 0} -// CHECK:STDOUT: !36 = !{!"p1 int", !28, i64 0} -// CHECK:STDOUT: !37 = !{i64 4} -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 26, type: !39, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !42) -// CHECK:STDOUT: !39 = !DISubroutineType(types: !40) -// CHECK:STDOUT: !40 = !{null, !41} -// CHECK:STDOUT: !41 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !42 = !{!43} -// CHECK:STDOUT: !43 = !DILocalVariable(arg: 1, scope: !38, type: !41) -// CHECK:STDOUT: !44 = !DILocation(line: 26, column: 23, scope: !38) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !46, line: 9, type: !30, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !46 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") -// CHECK:STDOUT: !47 = !DILocation(line: 9, column: 28, scope: !45) -// CHECK:STDOUT: !48 = !DILocation(line: 9, column: 21, scope: !45) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !1, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 18, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 20, column: 17, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 23, column: 3, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 13, column: 23, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 26, column: 23, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 19, column: 3, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 20, column: 3, scope: !12) +// CHECK:STDOUT: !22 = !DILocation(line: 21, column: 3, scope: !12) +// CHECK:STDOUT: !23 = !DILocation(line: 24, column: 3, scope: !12) +// CHECK:STDOUT: !24 = !DILocation(line: 25, column: 3, scope: !12) +// CHECK:STDOUT: !25 = !DILocation(line: 26, column: 3, scope: !12) +// CHECK:STDOUT: !26 = !DILocation(line: 17, column: 1, scope: !12) +// CHECK:STDOUT: !27 = !{!28, !28, i64 0} +// CHECK:STDOUT: !28 = !{!"p1 _ZTS1C", !29, i64 0} +// CHECK:STDOUT: !29 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !1, line: 5, type: !31, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !31 = !DISubroutineType(types: !32) +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !34 = !DILocation(line: 5, column: 7, scope: !30) +// CHECK:STDOUT: !35 = !{} +// CHECK:STDOUT: !36 = !{!37, !37, i64 0} +// CHECK:STDOUT: !37 = !{!"p1 int", !29, i64 0} +// CHECK:STDOUT: !38 = !{i64 4} +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 26, type: !40, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !43) +// CHECK:STDOUT: !40 = !DISubroutineType(types: !41) +// CHECK:STDOUT: !41 = !{null, !42} +// CHECK:STDOUT: !42 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !43 = !{!44} +// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !39, type: !42) +// CHECK:STDOUT: !45 = !DILocation(line: 26, column: 23, scope: !39) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !47, line: 9, type: !31, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !47 = !DIFile(filename: "min_prelude/parts/default.carbon", directory: "") +// CHECK:STDOUT: !48 = !DILocation(line: 9, column: 28, scope: !46) +// CHECK:STDOUT: !49 = !DILocation(line: 9, column: 21, scope: !46) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'return_references.carbon' @@ -538,15 +540,15 @@ fn GetRefs() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnCRef.call = call ptr @_Z10ReturnCRefv(), !dbg !14 -// CHECK:STDOUT: %ReturnCRRef.call = call ptr @_Z11ReturnCRRefv(), !dbg !15 -// CHECK:STDOUT: %ReturnConstCRef.call = call ptr @_Z15ReturnConstCRefv(), !dbg !16 -// CHECK:STDOUT: %ReturnIntRef.call = call ptr @_Z12ReturnIntRefv(), !dbg !17 -// CHECK:STDOUT: %ReturnIntRRef.call = call ptr @_Z13ReturnIntRRefv(), !dbg !18 -// CHECK:STDOUT: %ReturnConstIntRef.call = call ptr @_Z17ReturnConstIntRefv(), !dbg !19 -// CHECK:STDOUT: ret void, !dbg !20 +// CHECK:STDOUT: %ReturnCRef.call = call ptr @_Z10ReturnCRefv(), !dbg !15 +// CHECK:STDOUT: %ReturnCRRef.call = call ptr @_Z11ReturnCRRefv(), !dbg !16 +// CHECK:STDOUT: %ReturnConstCRef.call = call ptr @_Z15ReturnConstCRefv(), !dbg !17 +// CHECK:STDOUT: %ReturnIntRef.call = call ptr @_Z12ReturnIntRefv(), !dbg !18 +// CHECK:STDOUT: %ReturnIntRRef.call = call ptr @_Z13ReturnIntRRefv(), !dbg !19 +// CHECK:STDOUT: %ReturnConstIntRef.call = call ptr @_Z17ReturnConstIntRefv(), !dbg !20 +// CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef nonnull align 1 dereferenceable(1) ptr @_Z10ReturnCRefv() #1 @@ -575,20 +577,21 @@ fn GetRefs() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !1, line: 16, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 17, column: 22, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 18, column: 22, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 19, column: 28, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 21, column: 20, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 22, column: 20, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 23, column: 26, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 16, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !1, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 17, column: 22, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 18, column: 22, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 19, column: 28, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 21, column: 20, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 22, column: 20, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 23, column: 26, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 16, column: 1, scope: !12) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'return_references_via_thunk.carbon' @@ -599,15 +602,15 @@ fn GetRefs() { // CHECK:STDOUT: %class.ForceThunk = type { i8 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnCRef__carbon_thunk.call = call ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk.(), !dbg !14 -// CHECK:STDOUT: %ReturnCRRef__carbon_thunk.call = call ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk.(), !dbg !15 -// CHECK:STDOUT: %ReturnConstCRef__carbon_thunk.call = call ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk.(), !dbg !16 -// CHECK:STDOUT: %ReturnIntRef__carbon_thunk.call = call ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk.(), !dbg !17 -// CHECK:STDOUT: %ReturnIntRRef__carbon_thunk.call = call ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk.(), !dbg !18 -// CHECK:STDOUT: %ReturnConstIntRef__carbon_thunk.call = call ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk.(), !dbg !19 -// CHECK:STDOUT: ret void, !dbg !20 +// CHECK:STDOUT: %ReturnCRef__carbon_thunk.call = call ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk.(), !dbg !15 +// CHECK:STDOUT: %ReturnCRRef__carbon_thunk.call = call ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk.(), !dbg !16 +// CHECK:STDOUT: %ReturnConstCRef__carbon_thunk.call = call ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk.(), !dbg !17 +// CHECK:STDOUT: %ReturnIntRef__carbon_thunk.call = call ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk.(), !dbg !18 +// CHECK:STDOUT: %ReturnIntRRef__carbon_thunk.call = call ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk.(), !dbg !19 +// CHECK:STDOUT: %ReturnConstIntRef__carbon_thunk.call = call ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk.(), !dbg !20 +// CHECK:STDOUT: ret void, !dbg !21 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -685,18 +688,19 @@ fn GetRefs() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !1, line: 17, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 18, column: 22, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 19, column: 22, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 20, column: 28, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 22, column: 20, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 23, column: 20, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 24, column: 26, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 17, column: 1, scope: !11) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !1, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 18, column: 22, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 19, column: 22, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 20, column: 28, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 22, column: 20, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 23, column: 20, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 24, column: 26, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 17, column: 1, scope: !12) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon b/toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon index 186c5e9a7da2d..11571025a4efc 100644 --- a/toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon +++ b/toolchain/lower/testdata/interop/cpp/std_initializer_list.carbon @@ -133,57 +133,57 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: declare void @_CWithinLifetime.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitDirectly.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CInitDirectly.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !14 -// CHECK:STDOUT: %.loc13_50.3.temp = alloca [3 x i32], align 4, !dbg !15 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_50.3.temp), !dbg !15 -// CHECK:STDOUT: %.loc13_50.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 0, !dbg !15 -// CHECK:STDOUT: %.loc13_50.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 1, !dbg !15 -// CHECK:STDOUT: %.loc13_50.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 2, !dbg !15 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !14 -// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !14 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !14 -// CHECK:STDOUT: store ptr getelementptr inbounds ([3 x i32], ptr @array.loc13_50.15, i32 1), ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !14 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !16 -// CHECK:STDOUT: call void @"_COp.412b5e0eb082e888:core.Destroy.Core"(ptr @array), !dbg !15 -// CHECK:STDOUT: ret void, !dbg !17 +// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !15 +// CHECK:STDOUT: %.loc13_50.3.temp = alloca [3 x i32], align 4, !dbg !16 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_50.3.temp), !dbg !16 +// CHECK:STDOUT: %.loc13_50.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 0, !dbg !16 +// CHECK:STDOUT: %.loc13_50.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 1, !dbg !16 +// CHECK:STDOUT: %.loc13_50.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 2, !dbg !16 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !15 +// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !15 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !15 +// CHECK:STDOUT: store ptr getelementptr inbounds ([3 x i32], ptr @array.loc13_50.15, i32 1), ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !15 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !17 +// CHECK:STDOUT: call void @"_COp.412b5e0eb082e888:core.Destroy.Core"(ptr @array), !dbg !16 +// CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.412b5e0eb082e888:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// CHECK:STDOUT: define weak_odr void @"_COp.412b5e0eb082e888:core.Destroy.Core"(ptr %self) #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !32 { +// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !33 -// CHECK:STDOUT: %.loc18_36.2.temp = alloca [16 x i8], align 8, !dbg !34 -// CHECK:STDOUT: %.loc18_36.4.temp = alloca [3 x i32], align 4, !dbg !34 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !33 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.2.temp), !dbg !34 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.4.temp), !dbg !34 -// CHECK:STDOUT: %.loc18_36.5.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 0, !dbg !34 -// CHECK:STDOUT: %.loc18_36.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 1, !dbg !34 -// CHECK:STDOUT: %.loc18_36.11.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 2, !dbg !34 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 0, !dbg !34 -// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !34 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !34 -// CHECK:STDOUT: store ptr getelementptr inbounds ([3 x i32], ptr @array.loc13_50.15, i32 1), ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !34 -// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !33 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !35 -// CHECK:STDOUT: call void @"_COp.412b5e0eb082e888:core.Destroy.Core"(ptr @array), !dbg !34 -// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !33 -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !34 +// CHECK:STDOUT: %.loc18_36.2.temp = alloca [16 x i8], align 8, !dbg !35 +// CHECK:STDOUT: %.loc18_36.4.temp = alloca [3 x i32], align 4, !dbg !35 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !34 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.2.temp), !dbg !35 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.4.temp), !dbg !35 +// CHECK:STDOUT: %.loc18_36.5.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 0, !dbg !35 +// CHECK:STDOUT: %.loc18_36.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 1, !dbg !35 +// CHECK:STDOUT: %.loc18_36.11.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 2, !dbg !35 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 0, !dbg !35 +// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !35 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !35 +// CHECK:STDOUT: store ptr getelementptr inbounds ([3 x i32], ptr @array.loc13_50.15, i32 1), ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !35 +// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !34 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !36 +// CHECK:STDOUT: call void @"_COp.412b5e0eb082e888:core.Destroy.Core"(ptr @array), !dbg !35 +// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !34 +// CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -192,11 +192,11 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: %list.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %"class.std::initializer_list", align 8 -// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !37 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !40 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !40 -// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !37 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !42 +// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !38 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !41 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !41 +// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !38 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !43 // CHECK:STDOUT: %2 = getelementptr inbounds nuw { ptr, ptr }, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load ptr, ptr %2, align 8 // CHECK:STDOUT: %4 = getelementptr inbounds nuw { ptr, ptr }, ptr %agg.tmp, i32 0, i32 1 @@ -209,40 +209,40 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11vector_likeD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !40 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !41 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !45 { +// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !46 -// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !47 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !46 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !47 -// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !47 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !47 -// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !47 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !47 -// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !47 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !47 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !46 -// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !46 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !46 -// CHECK:STDOUT: %initializer_list.initializer_list.call.array.end = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 1, !dbg !46 -// CHECK:STDOUT: store ptr %initializer_list.initializer_list.call.array.end, ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !46 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !48 -// CHECK:STDOUT: call void @"_COp.8fea30d0bd4d6e84:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !47 -// CHECK:STDOUT: ret void, !dbg !49 +// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !47 +// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !48 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !47 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !48 +// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !48 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !48 +// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !48 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !48 +// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !48 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !48 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !47 +// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !47 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.end = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !47 +// CHECK:STDOUT: %initializer_list.initializer_list.call.array.end = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 1, !dbg !47 +// CHECK:STDOUT: store ptr %initializer_list.initializer_list.call.array.end, ptr %initializer_list.initializer_list.call.init_list.end, align 8, !dbg !47 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !49 +// CHECK:STDOUT: call void @"_COp.8fea30d0bd4d6e84:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !50 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !50 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !51 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !51 // CHECK:STDOUT: call void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -251,15 +251,15 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !50 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !51 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8fea30d0bd4d6e84:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: define weak_odr void @"_COp.8fea30d0bd4d6e84:core.Destroy.Core"(ptr %self) #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -277,7 +277,7 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: store ptr %list.coerce0, ptr %0, align 8 // CHECK:STDOUT: %1 = getelementptr inbounds nuw { ptr, ptr }, ptr %list, i32 0, i32 1 // CHECK:STDOUT: store ptr %list.coerce1, ptr %1, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !40 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !41 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -286,7 +286,7 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !50 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !51 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -311,55 +311,56 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "InitDirectly", linkageName: "_CInitDirectly.Main", scope: null, file: !1, line: 12, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 13, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 13, column: 42, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 14, column: 3, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 1, scope: !11) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 13, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) -// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) -// CHECK:STDOUT: !20 = !{null, !21} -// CHECK:STDOUT: !21 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !22 = !{!23} -// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !18, type: !21) -// CHECK:STDOUT: !24 = !DILocation(line: 13, column: 42, scope: !18) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.412b5e0eb082e888:core.Destroy.Core", scope: null, file: !1, line: 13, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !29) -// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) -// CHECK:STDOUT: !27 = !{null, !28} -// CHECK:STDOUT: !28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !29 = !{!30} -// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !25, type: !28) -// CHECK:STDOUT: !31 = !DILocation(line: 13, column: 42, scope: !25) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !1, line: 17, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !33 = !DILocation(line: 18, column: 3, scope: !32) -// CHECK:STDOUT: !34 = !DILocation(line: 18, column: 28, scope: !32) -// CHECK:STDOUT: !35 = !DILocation(line: 19, column: 3, scope: !32) -// CHECK:STDOUT: !36 = !DILocation(line: 17, column: 1, scope: !32) -// CHECK:STDOUT: !37 = !{!38, !38, i64 0} -// CHECK:STDOUT: !38 = !{!"p1 _ZTSSt16initializer_listIiE", !39, i64 0} -// CHECK:STDOUT: !39 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !40 = !{!41, !41, i64 0} -// CHECK:STDOUT: !41 = !{!"p1 _ZTS11vector_like", !39, i64 0} -// CHECK:STDOUT: !42 = !{i64 0, i64 8, !43, i64 8, i64 8, !43} -// CHECK:STDOUT: !43 = !{!44, !44, i64 0} -// CHECK:STDOUT: !44 = !{!"p1 int", !39, i64 0} -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !1, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !46 = !DILocation(line: 23, column: 3, scope: !45) -// CHECK:STDOUT: !47 = !DILocation(line: 23, column: 58, scope: !45) -// CHECK:STDOUT: !48 = !DILocation(line: 24, column: 3, scope: !45) -// CHECK:STDOUT: !49 = !DILocation(line: 22, column: 1, scope: !45) -// CHECK:STDOUT: !50 = !{!51, !51, i64 0} -// CHECK:STDOUT: !51 = !{!"p1 _ZTS15nontrivial_dtor", !39, i64 0} -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8fea30d0bd4d6e84:core.Destroy.Core", scope: null, file: !1, line: 23, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !53) -// CHECK:STDOUT: !53 = !{!54} -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !52, type: !28) -// CHECK:STDOUT: !55 = !DILocation(line: 23, column: 58, scope: !52) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "InitDirectly", linkageName: "_CInitDirectly.Main", scope: null, file: !1, line: 12, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 13, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 13, column: 42, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 14, column: 3, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 1, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 13, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !22} +// CHECK:STDOUT: !22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 13, column: 42, scope: !19) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.412b5e0eb082e888:core.Destroy.Core", scope: null, file: !1, line: 13, type: !27, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) +// CHECK:STDOUT: !27 = !DISubroutineType(types: !28) +// CHECK:STDOUT: !28 = !{null, !29} +// CHECK:STDOUT: !29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !30 = !{!31} +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !26, type: !29) +// CHECK:STDOUT: !32 = !DILocation(line: 13, column: 42, scope: !26) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !1, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !34 = !DILocation(line: 18, column: 3, scope: !33) +// CHECK:STDOUT: !35 = !DILocation(line: 18, column: 28, scope: !33) +// CHECK:STDOUT: !36 = !DILocation(line: 19, column: 3, scope: !33) +// CHECK:STDOUT: !37 = !DILocation(line: 17, column: 1, scope: !33) +// CHECK:STDOUT: !38 = !{!39, !39, i64 0} +// CHECK:STDOUT: !39 = !{!"p1 _ZTSSt16initializer_listIiE", !40, i64 0} +// CHECK:STDOUT: !40 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !41 = !{!42, !42, i64 0} +// CHECK:STDOUT: !42 = !{!"p1 _ZTS11vector_like", !40, i64 0} +// CHECK:STDOUT: !43 = !{i64 0, i64 8, !44, i64 8, i64 8, !44} +// CHECK:STDOUT: !44 = !{!45, !45, i64 0} +// CHECK:STDOUT: !45 = !{!"p1 int", !40, i64 0} +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !47 = !DILocation(line: 23, column: 3, scope: !46) +// CHECK:STDOUT: !48 = !DILocation(line: 23, column: 58, scope: !46) +// CHECK:STDOUT: !49 = !DILocation(line: 24, column: 3, scope: !46) +// CHECK:STDOUT: !50 = !DILocation(line: 22, column: 1, scope: !46) +// CHECK:STDOUT: !51 = !{!52, !52, i64 0} +// CHECK:STDOUT: !52 = !{!"p1 _ZTS15nontrivial_dtor", !40, i64 0} +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8fea30d0bd4d6e84:core.Destroy.Core", scope: null, file: !1, line: 23, type: !27, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !54) +// CHECK:STDOUT: !54 = !{!55} +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !29) +// CHECK:STDOUT: !56 = !DILocation(line: 23, column: 58, scope: !53) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'use_pointer_size.carbon' @@ -383,57 +384,57 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: declare void @_CWithinLifetime.Main() // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitDirectly.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CInitDirectly.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !14 -// CHECK:STDOUT: %.loc13_50.3.temp = alloca [3 x i32], align 4, !dbg !15 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_50.3.temp), !dbg !15 -// CHECK:STDOUT: %.loc13_50.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 0, !dbg !15 -// CHECK:STDOUT: %.loc13_50.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 1, !dbg !15 -// CHECK:STDOUT: %.loc13_50.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 2, !dbg !15 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !14 -// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !14 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !14 -// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !14 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !16 -// CHECK:STDOUT: call void @"_COp.412b5e0eb082e888:core.Destroy.Core"(ptr @array), !dbg !15 -// CHECK:STDOUT: ret void, !dbg !17 +// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !15 +// CHECK:STDOUT: %.loc13_50.3.temp = alloca [3 x i32], align 4, !dbg !16 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_50.3.temp), !dbg !16 +// CHECK:STDOUT: %.loc13_50.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 0, !dbg !16 +// CHECK:STDOUT: %.loc13_50.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 1, !dbg !16 +// CHECK:STDOUT: %.loc13_50.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc13_50.3.temp, i32 0, i64 2, !dbg !16 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !15 +// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !15 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !15 +// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !15 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !17 +// CHECK:STDOUT: call void @"_COp.412b5e0eb082e888:core.Destroy.Core"(ptr @array), !dbg !16 +// CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !18 { +// CHECK:STDOUT: define weak_odr void @"_COp.5e27612b9dd31a14:core.Destroy.Core"(ptr %self) #0 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !24 +// CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.412b5e0eb082e888:core.Destroy.Core"(ptr %self) #0 !dbg !25 { +// CHECK:STDOUT: define weak_odr void @"_COp.412b5e0eb082e888:core.Destroy.Core"(ptr %self) #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !32 { +// CHECK:STDOUT: define void @_CInitVectorLike.Main() #0 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !33 -// CHECK:STDOUT: %.loc18_36.2.temp = alloca [16 x i8], align 8, !dbg !34 -// CHECK:STDOUT: %.loc18_36.4.temp = alloca [3 x i32], align 4, !dbg !34 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !33 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.2.temp), !dbg !34 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.4.temp), !dbg !34 -// CHECK:STDOUT: %.loc18_36.5.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 0, !dbg !34 -// CHECK:STDOUT: %.loc18_36.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 1, !dbg !34 -// CHECK:STDOUT: %.loc18_36.11.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 2, !dbg !34 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 0, !dbg !34 -// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !34 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !34 -// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !34 -// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !33 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !35 -// CHECK:STDOUT: call void @"_COp.412b5e0eb082e888:core.Destroy.Core"(ptr @array), !dbg !34 -// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !33 -// CHECK:STDOUT: ret void, !dbg !36 +// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !34 +// CHECK:STDOUT: %.loc18_36.2.temp = alloca [16 x i8], align 8, !dbg !35 +// CHECK:STDOUT: %.loc18_36.4.temp = alloca [3 x i32], align 4, !dbg !35 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !34 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.2.temp), !dbg !35 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_36.4.temp), !dbg !35 +// CHECK:STDOUT: %.loc18_36.5.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 0, !dbg !35 +// CHECK:STDOUT: %.loc18_36.8.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 1, !dbg !35 +// CHECK:STDOUT: %.loc18_36.11.array.index = getelementptr inbounds [3 x i32], ptr %.loc18_36.4.temp, i32 0, i64 2, !dbg !35 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 0, !dbg !35 +// CHECK:STDOUT: store ptr @array.loc13_50.15, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !35 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %.loc18_36.2.temp, i32 0, i32 8, !dbg !35 +// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !35 +// CHECK:STDOUT: call void @_ZN11vector_likeC1ESt16initializer_listIiE.carbon_thunk._(ptr %.loc18_36.2.temp, ptr %_.var), !dbg !34 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !36 +// CHECK:STDOUT: call void @"_COp.412b5e0eb082e888:core.Destroy.Core"(ptr @array), !dbg !35 +// CHECK:STDOUT: call void @_ZN11vector_likeD2Ev(ptr %_.var), !dbg !34 +// CHECK:STDOUT: ret void, !dbg !37 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -442,11 +443,11 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: %list.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %"class.std::initializer_list", align 8 -// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !37 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !40 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !40 -// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !37 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !42 +// CHECK:STDOUT: store ptr %list, ptr %list.addr, align 8, !tbaa !38 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !41 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !41 +// CHECK:STDOUT: %1 = load ptr, ptr %list.addr, align 8, !tbaa !38 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %agg.tmp, ptr align 8 %1, i64 16, i1 false), !tbaa.struct !43 // CHECK:STDOUT: %2 = getelementptr inbounds nuw { ptr, i64 }, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load ptr, ptr %2, align 8 // CHECK:STDOUT: %4 = getelementptr inbounds nuw { ptr, i64 }, ptr %agg.tmp, i32 0, i32 1 @@ -459,39 +460,39 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN11vector_likeD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !40 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !41 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !47 { +// CHECK:STDOUT: define void @_CInitNontrivialDtor.Main() #0 !dbg !48 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !48 -// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !49 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !48 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !49 -// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !49 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !49 -// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !49 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !49 -// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !49 -// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !49 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !48 -// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !48 -// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !48 -// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !48 -// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !50 -// CHECK:STDOUT: call void @"_COp.8fea30d0bd4d6e84:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !49 -// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !49 +// CHECK:STDOUT: %.loc23_69.17.temp = alloca [3 x [1 x i8]], align 1, !dbg !50 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !49 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_69.17.temp), !dbg !50 +// CHECK:STDOUT: %.loc23_69.18.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 0, !dbg !50 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.18.array.index), !dbg !50 +// CHECK:STDOUT: %.loc23_69.16.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 1, !dbg !50 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.16.array.index), !dbg !50 +// CHECK:STDOUT: %.loc23_69.15.array.index = getelementptr inbounds [3 x [1 x i8]], ptr %.loc23_69.17.temp, i32 0, i64 2, !dbg !50 +// CHECK:STDOUT: call void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr %.loc23_69.15.array.index), !dbg !50 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.begin = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 0, !dbg !49 +// CHECK:STDOUT: store ptr %.loc23_69.17.temp, ptr %initializer_list.initializer_list.call.init_list.begin, align 8, !dbg !49 +// CHECK:STDOUT: %initializer_list.initializer_list.call.init_list.size = getelementptr inbounds nuw [16 x i8], ptr %_.var, i32 0, i32 8, !dbg !49 +// CHECK:STDOUT: store i64 3, ptr %initializer_list.initializer_list.call.init_list.size, align 8, !dbg !49 +// CHECK:STDOUT: call void @_CWithinLifetime.Main(), !dbg !51 +// CHECK:STDOUT: call void @"_COp.8fea30d0bd4d6e84:core.Destroy.Core"(ptr %.loc23_69.17.temp), !dbg !50 +// CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN15nontrivial_dtorC1Ev.carbon_thunk_tuple.(ptr noundef %return) #1 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !52 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !52 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !53 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !53 // CHECK:STDOUT: call void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -500,15 +501,15 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !52 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !53 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.8fea30d0bd4d6e84:core.Destroy.Core"(ptr %self) #0 !dbg !54 { +// CHECK:STDOUT: define weak_odr void @"_COp.8fea30d0bd4d6e84:core.Destroy.Core"(ptr %self) #0 !dbg !55 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !57 +// CHECK:STDOUT: ret void, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -526,7 +527,7 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: store ptr %list.coerce0, ptr %0, align 8 // CHECK:STDOUT: %1 = getelementptr inbounds nuw { ptr, i64 }, ptr %list, i32 0, i32 1 // CHECK:STDOUT: store i64 %list.coerce1, ptr %1, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !40 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !41 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -535,7 +536,7 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN15nontrivial_dtorC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #2 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !52 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !53 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -560,55 +561,56 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "InitDirectly", linkageName: "_CInitDirectly.Main", scope: null, file: !1, line: 12, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 13, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 13, column: 42, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 14, column: 3, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 1, scope: !11) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 13, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) -// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) -// CHECK:STDOUT: !20 = !{null, !21} -// CHECK:STDOUT: !21 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !22 = !{!23} -// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !18, type: !21) -// CHECK:STDOUT: !24 = !DILocation(line: 13, column: 42, scope: !18) -// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.412b5e0eb082e888:core.Destroy.Core", scope: null, file: !1, line: 13, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !29) -// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) -// CHECK:STDOUT: !27 = !{null, !28} -// CHECK:STDOUT: !28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !29 = !{!30} -// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !25, type: !28) -// CHECK:STDOUT: !31 = !DILocation(line: 13, column: 42, scope: !25) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !1, line: 17, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !33 = !DILocation(line: 18, column: 3, scope: !32) -// CHECK:STDOUT: !34 = !DILocation(line: 18, column: 28, scope: !32) -// CHECK:STDOUT: !35 = !DILocation(line: 19, column: 3, scope: !32) -// CHECK:STDOUT: !36 = !DILocation(line: 17, column: 1, scope: !32) -// CHECK:STDOUT: !37 = !{!38, !38, i64 0} -// CHECK:STDOUT: !38 = !{!"p1 _ZTSSt16initializer_listIiE", !39, i64 0} -// CHECK:STDOUT: !39 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !40 = !{!41, !41, i64 0} -// CHECK:STDOUT: !41 = !{!"p1 _ZTS11vector_like", !39, i64 0} -// CHECK:STDOUT: !42 = !{i64 0, i64 8, !43, i64 8, i64 8, !45} -// CHECK:STDOUT: !43 = !{!44, !44, i64 0} -// CHECK:STDOUT: !44 = !{!"p1 int", !39, i64 0} -// CHECK:STDOUT: !45 = !{!46, !46, i64 0} -// CHECK:STDOUT: !46 = !{!"long", !9, i64 0} -// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !1, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !48 = !DILocation(line: 23, column: 3, scope: !47) -// CHECK:STDOUT: !49 = !DILocation(line: 23, column: 58, scope: !47) -// CHECK:STDOUT: !50 = !DILocation(line: 24, column: 3, scope: !47) -// CHECK:STDOUT: !51 = !DILocation(line: 22, column: 1, scope: !47) -// CHECK:STDOUT: !52 = !{!53, !53, i64 0} -// CHECK:STDOUT: !53 = !{!"p1 _ZTS15nontrivial_dtor", !39, i64 0} -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8fea30d0bd4d6e84:core.Destroy.Core", scope: null, file: !1, line: 23, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !55) -// CHECK:STDOUT: !55 = !{!56} -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !54, type: !28) -// CHECK:STDOUT: !57 = !DILocation(line: 23, column: 58, scope: !54) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "InitDirectly", linkageName: "_CInitDirectly.Main", scope: null, file: !1, line: 12, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 13, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 13, column: 42, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 14, column: 3, scope: !12) +// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 1, scope: !12) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5e27612b9dd31a14:core.Destroy.Core", scope: null, file: !1, line: 13, type: !20, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !23) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null, !22} +// CHECK:STDOUT: !22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !23 = !{!24} +// CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !19, type: !22) +// CHECK:STDOUT: !25 = !DILocation(line: 13, column: 42, scope: !19) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp.412b5e0eb082e888:core.Destroy.Core", scope: null, file: !1, line: 13, type: !27, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) +// CHECK:STDOUT: !27 = !DISubroutineType(types: !28) +// CHECK:STDOUT: !28 = !{null, !29} +// CHECK:STDOUT: !29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !30 = !{!31} +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !26, type: !29) +// CHECK:STDOUT: !32 = !DILocation(line: 13, column: 42, scope: !26) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "InitVectorLike", linkageName: "_CInitVectorLike.Main", scope: null, file: !1, line: 17, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !34 = !DILocation(line: 18, column: 3, scope: !33) +// CHECK:STDOUT: !35 = !DILocation(line: 18, column: 28, scope: !33) +// CHECK:STDOUT: !36 = !DILocation(line: 19, column: 3, scope: !33) +// CHECK:STDOUT: !37 = !DILocation(line: 17, column: 1, scope: !33) +// CHECK:STDOUT: !38 = !{!39, !39, i64 0} +// CHECK:STDOUT: !39 = !{!"p1 _ZTSSt16initializer_listIiE", !40, i64 0} +// CHECK:STDOUT: !40 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !41 = !{!42, !42, i64 0} +// CHECK:STDOUT: !42 = !{!"p1 _ZTS11vector_like", !40, i64 0} +// CHECK:STDOUT: !43 = !{i64 0, i64 8, !44, i64 8, i64 8, !46} +// CHECK:STDOUT: !44 = !{!45, !45, i64 0} +// CHECK:STDOUT: !45 = !{!"p1 int", !40, i64 0} +// CHECK:STDOUT: !46 = !{!47, !47, i64 0} +// CHECK:STDOUT: !47 = !{!"long", !10, i64 0} +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "InitNontrivialDtor", linkageName: "_CInitNontrivialDtor.Main", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !49 = !DILocation(line: 23, column: 3, scope: !48) +// CHECK:STDOUT: !50 = !DILocation(line: 23, column: 58, scope: !48) +// CHECK:STDOUT: !51 = !DILocation(line: 24, column: 3, scope: !48) +// CHECK:STDOUT: !52 = !DILocation(line: 22, column: 1, scope: !48) +// CHECK:STDOUT: !53 = !{!54, !54, i64 0} +// CHECK:STDOUT: !54 = !{!"p1 _ZTS15nontrivial_dtor", !40, i64 0} +// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "Op", linkageName: "_COp.8fea30d0bd4d6e84:core.Destroy.Core", scope: null, file: !1, line: 23, type: !27, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !56) +// CHECK:STDOUT: !56 = !{!57} +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !55, type: !29) +// CHECK:STDOUT: !58 = !DILocation(line: 23, column: 58, scope: !55) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/template.carbon b/toolchain/lower/testdata/interop/cpp/template.carbon index 4800f8439ba15..86f9939342201 100644 --- a/toolchain/lower/testdata/interop/cpp/template.carbon +++ b/toolchain/lower/testdata/interop/cpp/template.carbon @@ -102,33 +102,33 @@ fn Call3() { // CHECK:STDOUT: $_Z8identityI5ClassET_S1_ = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CPassI32.Main(i32 %a) #0 !dbg !11 { +// CHECK:STDOUT: define i32 @_CPassI32.Main(i32 %a) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %identity.call = call i32 @_Z8identityIiET_S0_(i32 %a), !dbg !17 -// CHECK:STDOUT: ret i32 %identity.call, !dbg !18 +// CHECK:STDOUT: %identity.call = call i32 @_Z8identityIiET_S0_(i32 %a), !dbg !18 +// CHECK:STDOUT: ret i32 %identity.call, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define linkonce_odr dso_local noundef i32 @_Z8identityIiET_S0_(i32 noundef %x) #1 comdat { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.addr = alloca i32, align 4 -// CHECK:STDOUT: store i32 %x, ptr %x.addr, align 4, !tbaa !7 -// CHECK:STDOUT: %0 = load i32, ptr %x.addr, align 4, !tbaa !7 +// CHECK:STDOUT: store i32 %x, ptr %x.addr, align 4, !tbaa !20 +// CHECK:STDOUT: %0 = load i32, ptr %x.addr, align 4, !tbaa !20 // CHECK:STDOUT: ret i32 %0 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CPassI32Explicitly.Main(i32 %a) #0 !dbg !19 { +// CHECK:STDOUT: define i32 @_CPassI32Explicitly.Main(i32 %a) #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %identity.call = call i32 @_Z8identityIiET_S0_(i32 %a), !dbg !22 -// CHECK:STDOUT: ret i32 %identity.call, !dbg !23 +// CHECK:STDOUT: %identity.call = call i32 @_Z8identityIiET_S0_(i32 %a), !dbg !24 +// CHECK:STDOUT: ret i32 %identity.call, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassClass.Main(ptr sret({}) %return, ptr %a) #0 !dbg !24 { +// CHECK:STDOUT: define void @_CPassClass.Main(ptr sret({}) %return, ptr %a) #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z8identityI5ClassET_S1_.carbon_thunk._(ptr %a, ptr %return), !dbg !30 -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: call void @_Z8identityI5ClassET_S1_.carbon_thunk._(ptr %a, ptr %return), !dbg !32 +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -138,10 +138,10 @@ fn Call3() { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.Class, align 1 // CHECK:STDOUT: %undef.agg.tmp = alloca %class.Class, align 1 -// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !32 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !32 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !32 -// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !32 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !34 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !34 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !34 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !34 // CHECK:STDOUT: call void @_Z8identityI5ClassET_S1_() // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -168,34 +168,36 @@ fn Call3() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "PassI32", linkageName: "_CPassI32.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14, !14} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "PassI32Explicitly", linkageName: "_CPassI32Explicitly.Main", scope: null, file: !1, line: 10, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !20) -// CHECK:STDOUT: !20 = !{!21} -// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !19, type: !14) -// CHECK:STDOUT: !22 = !DILocation(line: 11, column: 10, scope: !19) -// CHECK:STDOUT: !23 = !DILocation(line: 11, column: 3, scope: !19) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "PassClass", linkageName: "_CPassClass.Main", scope: null, file: !1, line: 14, type: !25, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28) -// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !26 = !{!27, !27} -// CHECK:STDOUT: !27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !28 = !{!29} -// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !24, type: !27) -// CHECK:STDOUT: !30 = !DILocation(line: 15, column: 10, scope: !24) -// CHECK:STDOUT: !31 = !DILocation(line: 15, column: 3, scope: !24) -// CHECK:STDOUT: !32 = !{!33, !33, i64 0} -// CHECK:STDOUT: !33 = !{!"p1 _ZTS5Class", !34, i64 0} -// CHECK:STDOUT: !34 = !{!"any pointer", !9, i64 0} +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "PassI32", linkageName: "_CPassI32.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15, !15} +// CHECK:STDOUT: !15 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !{!9, !9, i64 0} +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "PassI32Explicitly", linkageName: "_CPassI32Explicitly.Main", scope: null, file: !1, line: 10, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !21, type: !15) +// CHECK:STDOUT: !24 = !DILocation(line: 11, column: 10, scope: !21) +// CHECK:STDOUT: !25 = !DILocation(line: 11, column: 3, scope: !21) +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "PassClass", linkageName: "_CPassClass.Main", scope: null, file: !1, line: 14, type: !27, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) +// CHECK:STDOUT: !27 = !DISubroutineType(types: !28) +// CHECK:STDOUT: !28 = !{!29, !29} +// CHECK:STDOUT: !29 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !30 = !{!31} +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !26, type: !29) +// CHECK:STDOUT: !32 = !DILocation(line: 15, column: 10, scope: !26) +// CHECK:STDOUT: !33 = !DILocation(line: 15, column: 3, scope: !26) +// CHECK:STDOUT: !34 = !{!35, !35, i64 0} +// CHECK:STDOUT: !35 = !{!"p1 _ZTS5Class", !36, i64 0} +// CHECK:STDOUT: !36 = !{!"any pointer", !10, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'variadic.carbon' @@ -204,28 +206,28 @@ fn Call3() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall1.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CCall1.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z3fooIJEEviDpT_(i32 1), !dbg !14 -// CHECK:STDOUT: ret void, !dbg !15 +// CHECK:STDOUT: call void @_Z3fooIJEEviDpT_(i32 1), !dbg !15 +// CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z3fooIJEEviDpT_(i32 noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall2.Main() #0 !dbg !16 { +// CHECK:STDOUT: define void @_CCall2.Main() #0 !dbg !17 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z3fooIJiEEviDpT_(i32 1, i32 2), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !18 +// CHECK:STDOUT: call void @_Z3fooIJiEEviDpT_(i32 1, i32 2), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z3fooIJiEEviDpT_(i32 noundef, i32 noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall3.Main() #0 !dbg !19 { +// CHECK:STDOUT: define void @_CCall3.Main() #0 !dbg !20 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z3fooIJiiEEviDpT_(i32 1, i32 2, i32 3), !dbg !20 -// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: call void @_Z3fooIJiiEEviDpT_(i32 1, i32 2, i32 3), !dbg !21 +// CHECK:STDOUT: ret void, !dbg !22 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z3fooIJiiEEviDpT_(i32 noundef, i32 noundef, i32 noundef) #1 @@ -244,21 +246,22 @@ fn Call3() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Call1", linkageName: "_CCall1.Main", scope: null, file: !1, line: 9, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 11, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 9, column: 1, scope: !11) -// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !1, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !17 = !DILocation(line: 17, column: 3, scope: !16) -// CHECK:STDOUT: !18 = !DILocation(line: 15, column: 1, scope: !16) -// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "Call3", linkageName: "_CCall3.Main", scope: null, file: !1, line: 21, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !20 = !DILocation(line: 23, column: 3, scope: !19) -// CHECK:STDOUT: !21 = !DILocation(line: 21, column: 1, scope: !19) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Call1", linkageName: "_CCall1.Main", scope: null, file: !1, line: 9, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 11, column: 3, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 9, column: 1, scope: !12) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !1, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !18 = !DILocation(line: 17, column: 3, scope: !17) +// CHECK:STDOUT: !19 = !DILocation(line: 15, column: 1, scope: !17) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Call3", linkageName: "_CCall3.Main", scope: null, file: !1, line: 21, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !21 = !DILocation(line: 23, column: 3, scope: !20) +// CHECK:STDOUT: !22 = !DILocation(line: 21, column: 1, scope: !20) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'variadic_thunk.carbon' @@ -272,12 +275,12 @@ fn Call3() { // CHECK:STDOUT: @X.val.loc12_14.3 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall1.Main() #0 !dbg !11 { +// CHECK:STDOUT: define void @_CCall1.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc12_12.2.temp = alloca {}, align 1, !dbg !14 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_12.2.temp), !dbg !14 -// CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_.carbon_thunk._(ptr @X.val.loc12_14.3), !dbg !15 -// CHECK:STDOUT: ret void, !dbg !16 +// CHECK:STDOUT: %.loc12_12.2.temp = alloca {}, align 1, !dbg !15 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_12.2.temp), !dbg !15 +// CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_.carbon_thunk._(ptr @X.val.loc12_14.3), !dbg !16 +// CHECK:STDOUT: ret void, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -285,19 +288,19 @@ fn Call3() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.X, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !17 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !18 // CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_() // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall2.Main() #0 !dbg !20 { +// CHECK:STDOUT: define void @_CCall2.Main() #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_12.2.temp = alloca {}, align 1, !dbg !21 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_12.2.temp), !dbg !21 -// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk.__(ptr @X.val.loc12_14.3, i32 2), !dbg !22 -// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: %.loc18_12.2.temp = alloca {}, align 1, !dbg !22 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_12.2.temp), !dbg !22 +// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk.__(ptr @X.val.loc12_14.3, i32 2), !dbg !23 +// CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -306,21 +309,21 @@ fn Call3() { // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %agg.tmp = alloca %class.X, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !17 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %3 = load i32, ptr %.addr1, align 4, !tbaa !7 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !18 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !25 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %3 = load i32, ptr %.addr1, align 4, !tbaa !25 // CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_(i32 noundef %3) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall3.Main() #0 !dbg !24 { +// CHECK:STDOUT: define void @_CCall3.Main() #0 !dbg !26 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc24_12.2.temp = alloca {}, align 1, !dbg !25 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_12.2.temp), !dbg !25 -// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk.___(ptr @X.val.loc12_14.3, i32 2, i32 3), !dbg !26 -// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: %.loc24_12.2.temp = alloca {}, align 1, !dbg !27 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_12.2.temp), !dbg !27 +// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk.___(ptr @X.val.loc12_14.3, i32 2, i32 3), !dbg !28 +// CHECK:STDOUT: ret void, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -330,12 +333,12 @@ fn Call3() { // CHECK:STDOUT: %.addr1 = alloca i32, align 4 // CHECK:STDOUT: %.addr2 = alloca i32, align 4 // CHECK:STDOUT: %agg.tmp = alloca %class.X, align 1 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !17 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !7 -// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !17 -// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !7 -// CHECK:STDOUT: %5 = load i32, ptr %.addr2, align 4, !tbaa !7 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !18 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !25 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !25 +// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !18 +// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !25 +// CHECK:STDOUT: %5 = load i32, ptr %.addr2, align 4, !tbaa !25 // CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_(i32 noundef %4, i32 noundef %5) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -368,25 +371,27 @@ fn Call3() { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Call1", linkageName: "_CCall1.Main", scope: null, file: !1, line: 10, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null} -// CHECK:STDOUT: !14 = !DILocation(line: 12, column: 11, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 12, column: 3, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 10, column: 1, scope: !11) -// CHECK:STDOUT: !17 = !{!18, !18, i64 0} -// CHECK:STDOUT: !18 = !{!"p1 _ZTS1X", !19, i64 0} -// CHECK:STDOUT: !19 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !1, line: 16, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !21 = !DILocation(line: 18, column: 11, scope: !20) -// CHECK:STDOUT: !22 = !DILocation(line: 18, column: 3, scope: !20) -// CHECK:STDOUT: !23 = !DILocation(line: 16, column: 1, scope: !20) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Call3", linkageName: "_CCall3.Main", scope: null, file: !1, line: 22, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !25 = !DILocation(line: 24, column: 11, scope: !24) -// CHECK:STDOUT: !26 = !DILocation(line: 24, column: 3, scope: !24) -// CHECK:STDOUT: !27 = !DILocation(line: 22, column: 1, scope: !24) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Call1", linkageName: "_CCall1.Main", scope: null, file: !1, line: 10, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null} +// CHECK:STDOUT: !15 = !DILocation(line: 12, column: 11, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 12, column: 3, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 10, column: 1, scope: !12) +// CHECK:STDOUT: !18 = !{!19, !19, i64 0} +// CHECK:STDOUT: !19 = !{!"p1 _ZTS1X", !20, i64 0} +// CHECK:STDOUT: !20 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !1, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !22 = !DILocation(line: 18, column: 11, scope: !21) +// CHECK:STDOUT: !23 = !DILocation(line: 18, column: 3, scope: !21) +// CHECK:STDOUT: !24 = !DILocation(line: 16, column: 1, scope: !21) +// CHECK:STDOUT: !25 = !{!9, !9, i64 0} +// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Call3", linkageName: "_CCall3.Main", scope: null, file: !1, line: 22, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !27 = !DILocation(line: 24, column: 11, scope: !26) +// CHECK:STDOUT: !28 = !DILocation(line: 24, column: 3, scope: !26) +// CHECK:STDOUT: !29 = !DILocation(line: 22, column: 1, scope: !26) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/thunks.carbon b/toolchain/lower/testdata/interop/cpp/thunks.carbon index 192fb3e57f8f6..121579012bfaa 100644 --- a/toolchain/lower/testdata/interop/cpp/thunks.carbon +++ b/toolchain/lower/testdata/interop/cpp/thunks.carbon @@ -104,14 +104,14 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall.Main(ptr %n) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CCall.Main(ptr %n) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %n2.var = alloca [1 x i8], align 1, !dbg !17 -// CHECK:STDOUT: %.loc9_34.1.temp = alloca [1 x i8], align 1, !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n2.var), !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_34.1.temp), !dbg !18 -// CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_.carbon_thunk._(ptr %n, ptr %n2.var), !dbg !18 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: %n2.var = alloca [1 x i8], align 1, !dbg !18 +// CHECK:STDOUT: %.loc9_34.1.temp = alloca [1 x i8], align 1, !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n2.var), !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_34.1.temp), !dbg !19 +// CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_.carbon_thunk._(ptr %n, ptr %n2.var), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -119,25 +119,25 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !20 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !20 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !20 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !20 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !21 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !21 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !21 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !21 // CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Copy.60e3c6e2415a2ad6.Core:NeedThunk.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !23 { +// CHECK:STDOUT: define void @"_COp:thunk:Copy.60e3c6e2415a2ad6.Core:NeedThunk.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !29 -// CHECK:STDOUT: ret void, !dbg !29 +// CHECK:STDOUT: call void @_ZN9NeedThunkC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !30 +// CHECK:STDOUT: ret void, !dbg !30 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Destroy.092ad14c7174f642.Core:NeedThunk.Cpp"(ptr %self) #2 !dbg !30 { +// CHECK:STDOUT: define void @"_COp:thunk:Destroy.092ad14c7174f642.Core:NeedThunk.Cpp"(ptr %self) #2 !dbg !31 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !33 +// CHECK:STDOUT: ret void, !dbg !34 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -165,33 +165,34 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 8, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 9, column: 3, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 9, column: 34, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 8, column: 1, scope: !11) -// CHECK:STDOUT: !20 = !{!21, !21, i64 0} -// CHECK:STDOUT: !21 = !{!"p1 _ZTS9NeedThunk", !22, i64 0} -// CHECK:STDOUT: !22 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.60e3c6e2415a2ad6.Core:NeedThunk.Cpp", scope: null, file: !24, line: 4, type: !25, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !27) -// CHECK:STDOUT: !24 = !DIFile(filename: "./need_thunk.h", directory: "") -// CHECK:STDOUT: !25 = !DISubroutineType(types: !26) -// CHECK:STDOUT: !26 = !{!14, !14} -// CHECK:STDOUT: !27 = !{!28} -// CHECK:STDOUT: !28 = !DILocalVariable(arg: 1, scope: !23, type: !14) -// CHECK:STDOUT: !29 = !DILocation(line: 4, column: 3, scope: !23) -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Destroy.092ad14c7174f642.Core:NeedThunk.Cpp", scope: null, file: !24, line: 5, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) -// CHECK:STDOUT: !31 = !{!32} -// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !30, type: !14) -// CHECK:STDOUT: !33 = !DILocation(line: 5, column: 3, scope: !30) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 8, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 9, column: 3, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 9, column: 34, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 8, column: 1, scope: !12) +// CHECK:STDOUT: !21 = !{!22, !22, i64 0} +// CHECK:STDOUT: !22 = !{!"p1 _ZTS9NeedThunk", !23, i64 0} +// CHECK:STDOUT: !23 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.60e3c6e2415a2ad6.Core:NeedThunk.Cpp", scope: null, file: !25, line: 4, type: !26, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !28) +// CHECK:STDOUT: !25 = !DIFile(filename: "./need_thunk.h", directory: "") +// CHECK:STDOUT: !26 = !DISubroutineType(types: !27) +// CHECK:STDOUT: !27 = !{!15, !15} +// CHECK:STDOUT: !28 = !{!29} +// CHECK:STDOUT: !29 = !DILocalVariable(arg: 1, scope: !24, type: !15) +// CHECK:STDOUT: !30 = !DILocation(line: 4, column: 3, scope: !24) +// CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Destroy.092ad14c7174f642.Core:NeedThunk.Cpp", scope: null, file: !25, line: 5, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !32) +// CHECK:STDOUT: !32 = !{!33} +// CHECK:STDOUT: !33 = !DILocalVariable(arg: 1, scope: !31, type: !15) +// CHECK:STDOUT: !34 = !DILocation(line: 5, column: 3, scope: !31) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'thunks_for_distinct_specializations.carbon' @@ -200,21 +201,21 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !18 -// CHECK:STDOUT: %.loc12_35.1.temp = alloca [1 x i8], align 1, !dbg !19 -// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !20 -// CHECK:STDOUT: %.loc13_35.1.temp = alloca [1 x i8], align 1, !dbg !21 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_35.1.temp), !dbg !19 -// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !19 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !20 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_35.1.temp), !dbg !21 -// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !21 -// CHECK:STDOUT: call void @_ZN3BoxI1BED1Ev(ptr %b2.var), !dbg !20 -// CHECK:STDOUT: call void @_ZN3BoxI1AED1Ev(ptr %a2.var), !dbg !18 -// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !19 +// CHECK:STDOUT: %.loc12_35.1.temp = alloca [1 x i8], align 1, !dbg !20 +// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !21 +// CHECK:STDOUT: %.loc13_35.1.temp = alloca [1 x i8], align 1, !dbg !22 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_35.1.temp), !dbg !20 +// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !20 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !21 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_35.1.temp), !dbg !22 +// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !22 +// CHECK:STDOUT: call void @_ZN3BoxI1BED1Ev(ptr %b2.var), !dbg !21 +// CHECK:STDOUT: call void @_ZN3BoxI1AED1Ev(ptr %a2.var), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -222,19 +223,19 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !23 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !23 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !24 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !24 // CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !26 { +// CHECK:STDOUT: define void @"_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !27 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !32 -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !33 +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -242,19 +243,19 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !33 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !33 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !33 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !33 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !34 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !34 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !34 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !34 // CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !35 { +// CHECK:STDOUT: define void @"_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !38 -// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !39 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind @@ -291,38 +292,39 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 11, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16, !17} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 2, scope: !11, type: !14) -// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 12, column: 35, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 13, column: 3, scope: !11) -// CHECK:STDOUT: !21 = !DILocation(line: 13, column: 35, scope: !11) -// CHECK:STDOUT: !22 = !DILocation(line: 11, column: 1, scope: !11) -// CHECK:STDOUT: !23 = !{!24, !24, i64 0} -// CHECK:STDOUT: !24 = !{!"p1 _ZTS3BoxI1AE", !25, i64 0} -// CHECK:STDOUT: !25 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp", scope: null, file: !27, line: 8, type: !28, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) -// CHECK:STDOUT: !27 = !DIFile(filename: "./box.h", directory: "") -// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) -// CHECK:STDOUT: !29 = !{!14, !14} -// CHECK:STDOUT: !30 = !{!31} -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !26, type: !14) -// CHECK:STDOUT: !32 = !DILocation(line: 8, column: 3, scope: !26) -// CHECK:STDOUT: !33 = !{!34, !34, i64 0} -// CHECK:STDOUT: !34 = !{!"p1 _ZTS3BoxI1BE", !25, i64 0} -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp", scope: null, file: !27, line: 8, type: !28, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !36) -// CHECK:STDOUT: !36 = !{!37} -// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !14) -// CHECK:STDOUT: !38 = !DILocation(line: 8, column: 3, scope: !35) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 11, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17, !18} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 2, scope: !12, type: !15) +// CHECK:STDOUT: !19 = !DILocation(line: 12, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 12, column: 35, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 13, column: 3, scope: !12) +// CHECK:STDOUT: !22 = !DILocation(line: 13, column: 35, scope: !12) +// CHECK:STDOUT: !23 = !DILocation(line: 11, column: 1, scope: !12) +// CHECK:STDOUT: !24 = !{!25, !25, i64 0} +// CHECK:STDOUT: !25 = !{!"p1 _ZTS3BoxI1AE", !26, i64 0} +// CHECK:STDOUT: !26 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp", scope: null, file: !28, line: 8, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) +// CHECK:STDOUT: !28 = !DIFile(filename: "./box.h", directory: "") +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{!15, !15} +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !27, type: !15) +// CHECK:STDOUT: !33 = !DILocation(line: 8, column: 3, scope: !27) +// CHECK:STDOUT: !34 = !{!35, !35, i64 0} +// CHECK:STDOUT: !35 = !{!"p1 _ZTS3BoxI1BE", !26, i64 0} +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp", scope: null, file: !28, line: 8, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !37) +// CHECK:STDOUT: !37 = !{!38} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !15) +// CHECK:STDOUT: !39 = !DILocation(line: 8, column: 3, scope: !36) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'thunks_for_anonymous_namespace_collision.carbon' @@ -335,21 +337,21 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: $_ZN7CollideC2ERKS_ = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !18 -// CHECK:STDOUT: %.loc12_32.1.temp = alloca [1 x i8], align 1, !dbg !19 -// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !20 -// CHECK:STDOUT: %.loc13_36.1.temp = alloca [1 x i8], align 1, !dbg !21 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !18 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_32.1.temp), !dbg !19 -// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !19 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !20 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_36.1.temp), !dbg !21 -// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !21 -// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideD2Ev(ptr %b2.var), !dbg !20 -// CHECK:STDOUT: call void @_ZN7CollideD2Ev(ptr %a2.var), !dbg !18 -// CHECK:STDOUT: ret void, !dbg !22 +// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !19 +// CHECK:STDOUT: %.loc12_32.1.temp = alloca [1 x i8], align 1, !dbg !20 +// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !21 +// CHECK:STDOUT: %.loc13_36.1.temp = alloca [1 x i8], align 1, !dbg !22 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !19 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_32.1.temp), !dbg !20 +// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !20 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !21 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_36.1.temp), !dbg !22 +// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !22 +// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideD2Ev(ptr %b2.var), !dbg !21 +// CHECK:STDOUT: call void @_ZN7CollideD2Ev(ptr %a2.var), !dbg !19 +// CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -357,19 +359,19 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !23 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !23 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !23 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !24 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !24 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !24 // CHECK:STDOUT: call void @_ZN7CollideC2ERKS_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !26 { +// CHECK:STDOUT: define void @"_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !27 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !32 -// CHECK:STDOUT: ret void, !dbg !32 +// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !33 +// CHECK:STDOUT: ret void, !dbg !33 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -377,26 +379,26 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !33 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !33 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !33 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !33 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !34 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !34 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !34 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !34 // CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC2ERKS0_(ptr noundef nonnull align 1 dereferenceable(1) %1, ptr noundef nonnull align 1 dereferenceable(1) %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define void @"_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !35 { +// CHECK:STDOUT: define void @"_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %self, ptr %return), !dbg !38 -// CHECK:STDOUT: ret void, !dbg !38 +// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %self, ptr %return), !dbg !39 +// CHECK:STDOUT: ret void, !dbg !39 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define internal void @_ZN12_GLOBAL__N_17CollideD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #3 align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !33 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !34 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -405,7 +407,7 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN7CollideD2Ev(ptr noundef nonnull align 1 dereferenceable(1) %this) unnamed_addr #3 comdat align 2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !23 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !24 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -418,8 +420,8 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !23 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !23 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !24 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !24 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -429,8 +431,8 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !33 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !33 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !34 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !34 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -455,36 +457,37 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 11, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16, !17} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocalVariable(arg: 2, scope: !11, type: !14) -// CHECK:STDOUT: !18 = !DILocation(line: 12, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 12, column: 32, scope: !11) -// CHECK:STDOUT: !20 = !DILocation(line: 13, column: 3, scope: !11) -// CHECK:STDOUT: !21 = !DILocation(line: 13, column: 36, scope: !11) -// CHECK:STDOUT: !22 = !DILocation(line: 11, column: 1, scope: !11) -// CHECK:STDOUT: !23 = !{!24, !24, i64 0} -// CHECK:STDOUT: !24 = !{!"p1 _ZTS7Collide", !25, i64 0} -// CHECK:STDOUT: !25 = !{!"any pointer", !9, i64 0} -// CHECK:STDOUT: !26 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp", scope: null, file: !27, line: 17, type: !28, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) -// CHECK:STDOUT: !27 = !DIFile(filename: "./anonymous_namespace_collision.h", directory: "") -// CHECK:STDOUT: !28 = !DISubroutineType(types: !29) -// CHECK:STDOUT: !29 = !{!14, !14} -// CHECK:STDOUT: !30 = !{!31} -// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !26, type: !14) -// CHECK:STDOUT: !32 = !DILocation(line: 17, column: 3, scope: !26) -// CHECK:STDOUT: !33 = !{!34, !34, i64 0} -// CHECK:STDOUT: !34 = !{!"p1 _ZTSN12_GLOBAL__N_17CollideE", !25, i64 0} -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp", scope: null, file: !27, line: 8, type: !28, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !36) -// CHECK:STDOUT: !36 = !{!37} -// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !35, type: !14) -// CHECK:STDOUT: !38 = !DILocation(line: 8, column: 3, scope: !35) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !1, line: 11, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17, !18} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocalVariable(arg: 2, scope: !12, type: !15) +// CHECK:STDOUT: !19 = !DILocation(line: 12, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 12, column: 32, scope: !12) +// CHECK:STDOUT: !21 = !DILocation(line: 13, column: 3, scope: !12) +// CHECK:STDOUT: !22 = !DILocation(line: 13, column: 36, scope: !12) +// CHECK:STDOUT: !23 = !DILocation(line: 11, column: 1, scope: !12) +// CHECK:STDOUT: !24 = !{!25, !25, i64 0} +// CHECK:STDOUT: !25 = !{!"p1 _ZTS7Collide", !26, i64 0} +// CHECK:STDOUT: !26 = !{!"any pointer", !10, i64 0} +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp", scope: null, file: !28, line: 17, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !31) +// CHECK:STDOUT: !28 = !DIFile(filename: "./anonymous_namespace_collision.h", directory: "") +// CHECK:STDOUT: !29 = !DISubroutineType(types: !30) +// CHECK:STDOUT: !30 = !{!15, !15} +// CHECK:STDOUT: !31 = !{!32} +// CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !27, type: !15) +// CHECK:STDOUT: !33 = !DILocation(line: 17, column: 3, scope: !27) +// CHECK:STDOUT: !34 = !{!35, !35, i64 0} +// CHECK:STDOUT: !35 = !{!"p1 _ZTSN12_GLOBAL__N_17CollideE", !26, i64 0} +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp", scope: null, file: !28, line: 8, type: !29, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !37) +// CHECK:STDOUT: !37 = !{!38} +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !36, type: !15) +// CHECK:STDOUT: !39 = !DILocation(line: 8, column: 3, scope: !36) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/void.carbon b/toolchain/lower/testdata/interop/cpp/void.carbon index 1a6949e18f302..de8647504c447 100644 --- a/toolchain/lower/testdata/interop/cpp/void.carbon +++ b/toolchain/lower/testdata/interop/cpp/void.carbon @@ -63,182 +63,182 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassVoidPtr.Main(ptr %a) #0 !dbg !11 { +// CHECK:STDOUT: define void @_CPassVoidPtr.Main(ptr %a) #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_21.2.temp = alloca ptr, align 8, !dbg !17 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.c14c4b15997bee86"(ptr %a), !dbg !17 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_21.2.temp), !dbg !17 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc7_21.2.temp, align 8, !dbg !17 -// CHECK:STDOUT: %.loc7_21.4 = load ptr, ptr %.loc7_21.2.temp, align 8, !dbg !17 -// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc7_21.4), !dbg !18 -// CHECK:STDOUT: call void @"_COp.f851aa344314c135:core.Destroy.Core"(ptr %.loc7_21.2.temp), !dbg !17 -// CHECK:STDOUT: ret void, !dbg !19 +// CHECK:STDOUT: %.loc7_21.2.temp = alloca ptr, align 8, !dbg !18 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.c14c4b15997bee86"(ptr %a), !dbg !18 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_21.2.temp), !dbg !18 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc7_21.2.temp, align 8, !dbg !18 +// CHECK:STDOUT: %.loc7_21.4 = load ptr, ptr %.loc7_21.2.temp, align 8, !dbg !18 +// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc7_21.4), !dbg !19 +// CHECK:STDOUT: call void @"_COp.f851aa344314c135:core.Destroy.Core"(ptr %.loc7_21.2.temp), !dbg !18 +// CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z13take_void_ptrPv(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.fd39a15e7d61228d:core.Destroy.Core"(ptr %self) #0 !dbg !20 { +// CHECK:STDOUT: define weak_odr void @"_COp.fd39a15e7d61228d:core.Destroy.Core"(ptr %self) #0 !dbg !21 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !23 +// CHECK:STDOUT: ret void, !dbg !24 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.125695b29f2cf97c:core.Destroy.Core"(ptr %self) #0 !dbg !24 { +// CHECK:STDOUT: define weak_odr void @"_COp.125695b29f2cf97c:core.Destroy.Core"(ptr %self) #0 !dbg !25 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !27 +// CHECK:STDOUT: ret void, !dbg !28 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.f851aa344314c135:core.Destroy.Core"(ptr %self) #0 !dbg !28 { +// CHECK:STDOUT: define weak_odr void @"_COp.f851aa344314c135:core.Destroy.Core"(ptr %self) #0 !dbg !29 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !31 +// CHECK:STDOUT: ret void, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassIntPtr.Main(ptr %a) #0 !dbg !32 { +// CHECK:STDOUT: define void @_CPassIntPtr.Main(ptr %a) #0 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_21.2.temp = alloca ptr, align 8, !dbg !35 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.8c5449d223152401"(ptr %a), !dbg !35 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.2.temp), !dbg !35 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.2.temp, align 8, !dbg !35 -// CHECK:STDOUT: %.loc11_21.4 = load ptr, ptr %.loc11_21.2.temp, align 8, !dbg !35 -// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc11_21.4), !dbg !36 -// CHECK:STDOUT: call void @"_COp.f851aa344314c135:core.Destroy.Core"(ptr %.loc11_21.2.temp), !dbg !35 -// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: %.loc11_21.2.temp = alloca ptr, align 8, !dbg !36 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.8c5449d223152401"(ptr %a), !dbg !36 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.2.temp), !dbg !36 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.2.temp, align 8, !dbg !36 +// CHECK:STDOUT: %.loc11_21.4 = load ptr, ptr %.loc11_21.2.temp, align 8, !dbg !36 +// CHECK:STDOUT: call void @_Z13take_void_ptrPv(ptr %.loc11_21.4), !dbg !37 +// CHECK:STDOUT: call void @"_COp.f851aa344314c135:core.Destroy.Core"(ptr %.loc11_21.2.temp), !dbg !36 +// CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !38 { +// CHECK:STDOUT: define void @_CPassIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !39 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc15_27.2.temp = alloca ptr, align 8, !dbg !41 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.829156f00ffa2f85"(ptr %a), !dbg !41 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc15_27.2.temp), !dbg !41 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc15_27.2.temp, align 8, !dbg !41 -// CHECK:STDOUT: %.loc15_27.4 = load ptr, ptr %.loc15_27.2.temp, align 8, !dbg !41 -// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc15_27.4), !dbg !42 -// CHECK:STDOUT: call void @"_COp.6755857d68a4faff:core.Destroy.Core"(ptr %.loc15_27.2.temp), !dbg !41 -// CHECK:STDOUT: ret void, !dbg !43 +// CHECK:STDOUT: %.loc15_27.2.temp = alloca ptr, align 8, !dbg !42 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.829156f00ffa2f85"(ptr %a), !dbg !42 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc15_27.2.temp), !dbg !42 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc15_27.2.temp, align 8, !dbg !42 +// CHECK:STDOUT: %.loc15_27.4 = load ptr, ptr %.loc15_27.2.temp, align 8, !dbg !42 +// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc15_27.4), !dbg !43 +// CHECK:STDOUT: call void @"_COp.6755857d68a4faff:core.Destroy.Core"(ptr %.loc15_27.2.temp), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z19take_const_void_ptrPKv(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.0aac4ce7c7765bae:core.Destroy.Core"(ptr %self) #0 !dbg !44 { +// CHECK:STDOUT: define weak_odr void @"_COp.0aac4ce7c7765bae:core.Destroy.Core"(ptr %self) #0 !dbg !45 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: ret void, !dbg !48 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.b8b38d4701ca7f8c:core.Destroy.Core"(ptr %self) #0 !dbg !48 { +// CHECK:STDOUT: define weak_odr void @"_COp.b8b38d4701ca7f8c:core.Destroy.Core"(ptr %self) #0 !dbg !49 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !51 +// CHECK:STDOUT: ret void, !dbg !52 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.6755857d68a4faff:core.Destroy.Core"(ptr %self) #0 !dbg !52 { +// CHECK:STDOUT: define weak_odr void @"_COp.6755857d68a4faff:core.Destroy.Core"(ptr %self) #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassConstIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !56 { +// CHECK:STDOUT: define void @_CPassConstIntPtrToConstVoidPtr.Main(ptr %a) #0 !dbg !57 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc19_27.2.temp = alloca ptr, align 8, !dbg !59 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.829156f00ffa2f85"(ptr %a), !dbg !59 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_27.2.temp), !dbg !59 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc19_27.2.temp, align 8, !dbg !59 -// CHECK:STDOUT: %.loc19_27.4 = load ptr, ptr %.loc19_27.2.temp, align 8, !dbg !59 -// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc19_27.4), !dbg !60 -// CHECK:STDOUT: call void @"_COp.6755857d68a4faff:core.Destroy.Core"(ptr %.loc19_27.2.temp), !dbg !59 -// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: %.loc19_27.2.temp = alloca ptr, align 8, !dbg !60 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.829156f00ffa2f85"(ptr %a), !dbg !60 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_27.2.temp), !dbg !60 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc19_27.2.temp, align 8, !dbg !60 +// CHECK:STDOUT: %.loc19_27.4 = load ptr, ptr %.loc19_27.2.temp, align 8, !dbg !60 +// CHECK:STDOUT: call void @_Z19take_const_void_ptrPKv(ptr %.loc19_27.4), !dbg !61 +// CHECK:STDOUT: call void @"_COp.6755857d68a4faff:core.Destroy.Core"(ptr %.loc19_27.2.temp), !dbg !60 +// CHECK:STDOUT: ret void, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.c14c4b15997bee86"(ptr %self) #0 !dbg !62 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.9ca4a8a75282568d"(ptr %self), !dbg !68 -// CHECK:STDOUT: ret ptr %1, !dbg !69 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.c14c4b15997bee86"(ptr %self) #0 !dbg !63 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.9ca4a8a75282568d"(ptr %self), !dbg !69 +// CHECK:STDOUT: ret ptr %1, !dbg !70 // CHECK:STDOUT: } // 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)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.8c5449d223152401"(ptr %self) #0 !dbg !70 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.92767fefc702cdf5"(ptr %self), !dbg !73 -// CHECK:STDOUT: ret ptr %1, !dbg !74 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.8c5449d223152401"(ptr %self) #0 !dbg !71 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.92767fefc702cdf5"(ptr %self), !dbg !74 +// CHECK:STDOUT: ret ptr %1, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.829156f00ffa2f85"(ptr %self) #0 !dbg !75 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.8f07a49808730bc0"(ptr %self), !dbg !78 -// CHECK:STDOUT: ret ptr %1, !dbg !79 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.829156f00ffa2f85"(ptr %self) #0 !dbg !76 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.8f07a49808730bc0"(ptr %self), !dbg !79 +// CHECK:STDOUT: ret ptr %1, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.9ca4a8a75282568d"(ptr %self) #0 !dbg !80 { -// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.9ca4a8a75282568d(ptr %self), !dbg !83 -// CHECK:STDOUT: ret ptr %1, !dbg !84 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.9ca4a8a75282568d"(ptr %self) #0 !dbg !81 { +// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.9ca4a8a75282568d(ptr %self), !dbg !84 +// CHECK:STDOUT: ret ptr %1, !dbg !85 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.92767fefc702cdf5"(ptr %self) #0 !dbg !85 { -// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !88 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !88 -// CHECK:STDOUT: store ptr %self, ptr %temp, align 8, !dbg !88 -// CHECK:STDOUT: %1 = load ptr, ptr %temp, align 8, !dbg !88 -// CHECK:STDOUT: %2 = call ptr @_CSome.Optional.Core.9ca4a8a75282568d(ptr %1), !dbg !89 -// CHECK:STDOUT: ret ptr %2, !dbg !90 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.92767fefc702cdf5"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !89 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !89 +// CHECK:STDOUT: store ptr %self, ptr %temp, align 8, !dbg !89 +// CHECK:STDOUT: %1 = load ptr, ptr %temp, align 8, !dbg !89 +// CHECK:STDOUT: %2 = call ptr @_CSome.Optional.Core.9ca4a8a75282568d(ptr %1), !dbg !90 +// CHECK:STDOUT: ret ptr %2, !dbg !91 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.8f07a49808730bc0"(ptr %self) #0 !dbg !91 { -// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !94 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !94 -// CHECK:STDOUT: %1 = call ptr @"_CConvert:thunk:ImplicitAs.d035546bf1a99743.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self), !dbg !94 -// CHECK:STDOUT: store ptr %1, ptr %temp, align 8, !dbg !94 -// CHECK:STDOUT: %2 = load ptr, ptr %temp, align 8, !dbg !94 -// CHECK:STDOUT: %3 = call ptr @_CSome.Optional.Core.8706aff08f648688(ptr %2), !dbg !95 -// CHECK:STDOUT: ret ptr %3, !dbg !96 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.8f07a49808730bc0"(ptr %self) #0 !dbg !92 { +// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !95 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !95 +// CHECK:STDOUT: %1 = call ptr @"_CConvert:thunk:ImplicitAs.d035546bf1a99743.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self), !dbg !95 +// CHECK:STDOUT: store ptr %1, ptr %temp, align 8, !dbg !95 +// CHECK:STDOUT: %2 = load ptr, ptr %temp, align 8, !dbg !95 +// CHECK:STDOUT: %3 = call ptr @_CSome.Optional.Core.8706aff08f648688(ptr %2), !dbg !96 +// CHECK:STDOUT: ret ptr %3, !dbg !97 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.9ca4a8a75282568d(ptr %value) #0 !dbg !97 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %value), !dbg !100 -// CHECK:STDOUT: ret ptr %1, !dbg !101 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.9ca4a8a75282568d(ptr %value) #0 !dbg !98 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %value), !dbg !101 +// CHECK:STDOUT: ret ptr %1, !dbg !102 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert:thunk:ImplicitAs.d035546bf1a99743.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self) #3 !dbg !102 { -// CHECK:STDOUT: ret ptr %self, !dbg !106 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert:thunk:ImplicitAs.d035546bf1a99743.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba"(ptr %self) #3 !dbg !103 { +// CHECK:STDOUT: ret ptr %self, !dbg !107 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.8706aff08f648688(ptr %value) #0 !dbg !107 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %value), !dbg !110 -// CHECK:STDOUT: ret ptr %1, !dbg !111 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.8706aff08f648688(ptr %value) #0 !dbg !108 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %value), !dbg !111 +// CHECK:STDOUT: ret ptr %1, !dbg !112 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %self) #0 !dbg !112 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !115 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !115 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !115 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !116 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !117 -// CHECK:STDOUT: call void @"_COp.125695b29f2cf97c:core.Destroy.Core"(ptr %1), !dbg !115 -// CHECK:STDOUT: ret ptr %2, !dbg !118 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271"(ptr %self) #0 !dbg !113 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !116 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !116 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !116 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !117 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !118 +// CHECK:STDOUT: call void @"_COp.125695b29f2cf97c:core.Destroy.Core"(ptr %1), !dbg !116 +// CHECK:STDOUT: ret ptr %2, !dbg !119 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %self) #0 !dbg !119 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !122 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !122 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !122 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !123 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !124 -// CHECK:STDOUT: call void @"_COp.b8b38d4701ca7f8c:core.Destroy.Core"(ptr %1), !dbg !122 -// CHECK:STDOUT: ret ptr %2, !dbg !125 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137"(ptr %self) #0 !dbg !120 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !123 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !123 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !123 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !124 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !125 +// CHECK:STDOUT: call void @"_COp.b8b38d4701ca7f8c:core.Destroy.Core"(ptr %1), !dbg !123 +// CHECK:STDOUT: ret ptr %2, !dbg !126 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -262,125 +262,126 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "PassVoidPtr", linkageName: "_CPassVoidPtr.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !15) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{null, !14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !{!16} -// CHECK:STDOUT: !16 = !DILocalVariable(arg: 1, scope: !11, type: !14) -// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 21, scope: !11) -// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !19 = !DILocation(line: 6, column: 1, scope: !11) -// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fd39a15e7d61228d:core.Destroy.Core", scope: null, file: !1, line: 7, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) -// CHECK:STDOUT: !21 = !{!22} -// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !20, type: !14) -// CHECK:STDOUT: !23 = !DILocation(line: 7, column: 21, scope: !20) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "Op", linkageName: "_COp.125695b29f2cf97c:core.Destroy.Core", scope: null, file: !1, line: 7, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !25) -// CHECK:STDOUT: !25 = !{!26} -// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !24, type: !14) -// CHECK:STDOUT: !27 = !DILocation(line: 7, column: 21, scope: !24) -// CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f851aa344314c135:core.Destroy.Core", scope: null, file: !1, line: 7, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !29) -// CHECK:STDOUT: !29 = !{!30} -// CHECK:STDOUT: !30 = !DILocalVariable(arg: 1, scope: !28, type: !14) -// CHECK:STDOUT: !31 = !DILocation(line: 7, column: 21, scope: !28) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "PassIntPtr", linkageName: "_CPassIntPtr.Main", scope: null, file: !1, line: 10, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33) -// CHECK:STDOUT: !33 = !{!34} -// CHECK:STDOUT: !34 = !DILocalVariable(arg: 1, scope: !32, type: !14) -// CHECK:STDOUT: !35 = !DILocation(line: 11, column: 21, scope: !32) -// CHECK:STDOUT: !36 = !DILocation(line: 11, column: 3, scope: !32) -// CHECK:STDOUT: !37 = !DILocation(line: 10, column: 1, scope: !32) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "PassIntPtrToConstVoidPtr", linkageName: "_CPassIntPtrToConstVoidPtr.Main", scope: null, file: !1, line: 14, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !39) -// CHECK:STDOUT: !39 = !{!40} -// CHECK:STDOUT: !40 = !DILocalVariable(arg: 1, scope: !38, type: !14) -// CHECK:STDOUT: !41 = !DILocation(line: 15, column: 27, scope: !38) -// CHECK:STDOUT: !42 = !DILocation(line: 15, column: 3, scope: !38) -// CHECK:STDOUT: !43 = !DILocation(line: 14, column: 1, scope: !38) -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0aac4ce7c7765bae:core.Destroy.Core", scope: null, file: !1, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !45) -// CHECK:STDOUT: !45 = !{!46} -// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !44, type: !14) -// CHECK:STDOUT: !47 = !DILocation(line: 15, column: 27, scope: !44) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b8b38d4701ca7f8c:core.Destroy.Core", scope: null, file: !1, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !49) -// CHECK:STDOUT: !49 = !{!50} -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !48, type: !14) -// CHECK:STDOUT: !51 = !DILocation(line: 15, column: 27, scope: !48) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6755857d68a4faff:core.Destroy.Core", scope: null, file: !1, line: 15, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !53) -// CHECK:STDOUT: !53 = !{!54} -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !52, type: !14) -// CHECK:STDOUT: !55 = !DILocation(line: 15, column: 27, scope: !52) -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "PassConstIntPtrToConstVoidPtr", linkageName: "_CPassConstIntPtrToConstVoidPtr.Main", scope: null, file: !1, line: 18, type: !12, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !57) -// CHECK:STDOUT: !57 = !{!58} -// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !56, type: !14) -// CHECK:STDOUT: !59 = !DILocation(line: 19, column: 27, scope: !56) -// CHECK:STDOUT: !60 = !DILocation(line: 19, column: 3, scope: !56) -// CHECK:STDOUT: !61 = !DILocation(line: 18, column: 1, scope: !56) -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.c14c4b15997bee86", scope: null, file: !63, line: 105, type: !64, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !66) -// CHECK:STDOUT: !63 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !64 = !DISubroutineType(types: !65) -// CHECK:STDOUT: !65 = !{!14, !14} -// CHECK:STDOUT: !66 = !{!67} -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !62, type: !14) -// CHECK:STDOUT: !68 = !DILocation(line: 106, column: 12, scope: !62) -// CHECK:STDOUT: !69 = !DILocation(line: 106, column: 5, scope: !62) -// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.8c5449d223152401", scope: null, file: !63, line: 105, type: !64, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !71) -// CHECK:STDOUT: !71 = !{!72} -// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !70, type: !14) -// CHECK:STDOUT: !73 = !DILocation(line: 106, column: 12, scope: !70) -// CHECK:STDOUT: !74 = !DILocation(line: 106, column: 5, scope: !70) -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.829156f00ffa2f85", scope: null, file: !63, line: 105, type: !64, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !76) -// CHECK:STDOUT: !76 = !{!77} -// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !75, type: !14) -// CHECK:STDOUT: !78 = !DILocation(line: 106, column: 12, scope: !75) -// CHECK:STDOUT: !79 = !DILocation(line: 106, column: 5, scope: !75) -// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.9ca4a8a75282568d", scope: null, file: !63, line: 80, type: !64, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !81) -// CHECK:STDOUT: !81 = !{!82} -// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !80, type: !14) -// CHECK:STDOUT: !83 = !DILocation(line: 81, column: 12, scope: !80) -// CHECK:STDOUT: !84 = !DILocation(line: 81, column: 5, scope: !80) -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.92767fefc702cdf5", scope: null, file: !63, line: 87, type: !64, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !86) -// CHECK:STDOUT: !86 = !{!87} -// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !85, type: !14) -// CHECK:STDOUT: !88 = !DILocation(line: 88, column: 29, scope: !85) -// CHECK:STDOUT: !89 = !DILocation(line: 88, column: 12, scope: !85) -// CHECK:STDOUT: !90 = !DILocation(line: 88, column: 5, scope: !85) -// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.8f07a49808730bc0", scope: null, file: !63, line: 87, type: !64, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !92) -// CHECK:STDOUT: !92 = !{!93} -// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !91, type: !14) -// CHECK:STDOUT: !94 = !DILocation(line: 88, column: 29, scope: !91) -// CHECK:STDOUT: !95 = !DILocation(line: 88, column: 12, scope: !91) -// CHECK:STDOUT: !96 = !DILocation(line: 88, column: 5, scope: !91) -// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.9ca4a8a75282568d", scope: null, file: !63, line: 33, type: !64, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !98) -// CHECK:STDOUT: !98 = !{!99} -// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !97, type: !14) -// CHECK:STDOUT: !100 = !DILocation(line: 34, column: 12, scope: !97) -// CHECK:STDOUT: !101 = !DILocation(line: 34, column: 5, scope: !97) -// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert:thunk:ImplicitAs.d035546bf1a99743.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba", scope: null, file: !103, line: 40, type: !64, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !104) -// CHECK:STDOUT: !103 = !DIFile(filename: "{{.*}}/prelude/types/cpp/void.carbon", directory: "") -// CHECK:STDOUT: !104 = !{!105} -// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !102, type: !14) -// CHECK:STDOUT: !106 = !DILocation(line: 40, column: 3, scope: !102) -// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.8706aff08f648688", scope: null, file: !63, line: 33, type: !64, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !108) -// CHECK:STDOUT: !108 = !{!109} -// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !107, type: !14) -// CHECK:STDOUT: !110 = !DILocation(line: 34, column: 12, scope: !107) -// CHECK:STDOUT: !111 = !DILocation(line: 34, column: 5, scope: !107) -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271", scope: null, file: !63, line: 166, type: !64, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !113) -// CHECK:STDOUT: !113 = !{!114} -// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !112, type: !14) -// CHECK:STDOUT: !115 = !DILocation(line: 167, column: 14, scope: !112) -// CHECK:STDOUT: !116 = !DILocation(line: 169, column: 5, scope: !112) -// CHECK:STDOUT: !117 = !DILocation(line: 167, column: 18, scope: !112) -// CHECK:STDOUT: !118 = !DILocation(line: 170, column: 5, scope: !112) -// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137", scope: null, file: !63, line: 166, type: !64, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !120) -// CHECK:STDOUT: !120 = !{!121} -// CHECK:STDOUT: !121 = !DILocalVariable(arg: 1, scope: !119, type: !14) -// CHECK:STDOUT: !122 = !DILocation(line: 167, column: 14, scope: !119) -// CHECK:STDOUT: !123 = !DILocation(line: 169, column: 5, scope: !119) -// CHECK:STDOUT: !124 = !DILocation(line: 167, column: 18, scope: !119) -// CHECK:STDOUT: !125 = !DILocation(line: 170, column: 5, scope: !119) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "PassVoidPtr", linkageName: "_CPassVoidPtr.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !16) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{null, !15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !{!17} +// CHECK:STDOUT: !17 = !DILocalVariable(arg: 1, scope: !12, type: !15) +// CHECK:STDOUT: !18 = !DILocation(line: 7, column: 21, scope: !12) +// CHECK:STDOUT: !19 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !20 = !DILocation(line: 6, column: 1, scope: !12) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fd39a15e7d61228d:core.Destroy.Core", scope: null, file: !1, line: 7, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !22) +// CHECK:STDOUT: !22 = !{!23} +// CHECK:STDOUT: !23 = !DILocalVariable(arg: 1, scope: !21, type: !15) +// CHECK:STDOUT: !24 = !DILocation(line: 7, column: 21, scope: !21) +// CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Op", linkageName: "_COp.125695b29f2cf97c:core.Destroy.Core", scope: null, file: !1, line: 7, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !26) +// CHECK:STDOUT: !26 = !{!27} +// CHECK:STDOUT: !27 = !DILocalVariable(arg: 1, scope: !25, type: !15) +// CHECK:STDOUT: !28 = !DILocation(line: 7, column: 21, scope: !25) +// CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Op", linkageName: "_COp.f851aa344314c135:core.Destroy.Core", scope: null, file: !1, line: 7, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !30) +// CHECK:STDOUT: !30 = !{!31} +// CHECK:STDOUT: !31 = !DILocalVariable(arg: 1, scope: !29, type: !15) +// CHECK:STDOUT: !32 = !DILocation(line: 7, column: 21, scope: !29) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "PassIntPtr", linkageName: "_CPassIntPtr.Main", scope: null, file: !1, line: 10, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !34) +// CHECK:STDOUT: !34 = !{!35} +// CHECK:STDOUT: !35 = !DILocalVariable(arg: 1, scope: !33, type: !15) +// CHECK:STDOUT: !36 = !DILocation(line: 11, column: 21, scope: !33) +// CHECK:STDOUT: !37 = !DILocation(line: 11, column: 3, scope: !33) +// CHECK:STDOUT: !38 = !DILocation(line: 10, column: 1, scope: !33) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "PassIntPtrToConstVoidPtr", linkageName: "_CPassIntPtrToConstVoidPtr.Main", scope: null, file: !1, line: 14, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !40) +// CHECK:STDOUT: !40 = !{!41} +// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !39, type: !15) +// CHECK:STDOUT: !42 = !DILocation(line: 15, column: 27, scope: !39) +// CHECK:STDOUT: !43 = !DILocation(line: 15, column: 3, scope: !39) +// CHECK:STDOUT: !44 = !DILocation(line: 14, column: 1, scope: !39) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Op", linkageName: "_COp.0aac4ce7c7765bae:core.Destroy.Core", scope: null, file: !1, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !46) +// CHECK:STDOUT: !46 = !{!47} +// CHECK:STDOUT: !47 = !DILocalVariable(arg: 1, scope: !45, type: !15) +// CHECK:STDOUT: !48 = !DILocation(line: 15, column: 27, scope: !45) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "Op", linkageName: "_COp.b8b38d4701ca7f8c:core.Destroy.Core", scope: null, file: !1, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !50) +// CHECK:STDOUT: !50 = !{!51} +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !49, type: !15) +// CHECK:STDOUT: !52 = !DILocation(line: 15, column: 27, scope: !49) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Op", linkageName: "_COp.6755857d68a4faff:core.Destroy.Core", scope: null, file: !1, line: 15, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !54) +// CHECK:STDOUT: !54 = !{!55} +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !15) +// CHECK:STDOUT: !56 = !DILocation(line: 15, column: 27, scope: !53) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "PassConstIntPtrToConstVoidPtr", linkageName: "_CPassConstIntPtrToConstVoidPtr.Main", scope: null, file: !1, line: 18, type: !13, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !58) +// CHECK:STDOUT: !58 = !{!59} +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !57, type: !15) +// CHECK:STDOUT: !60 = !DILocation(line: 19, column: 27, scope: !57) +// CHECK:STDOUT: !61 = !DILocation(line: 19, column: 3, scope: !57) +// CHECK:STDOUT: !62 = !DILocation(line: 18, column: 1, scope: !57) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.c14c4b15997bee86", scope: null, file: !64, line: 105, type: !65, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !67) +// CHECK:STDOUT: !64 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !65 = !DISubroutineType(types: !66) +// CHECK:STDOUT: !66 = !{!15, !15} +// CHECK:STDOUT: !67 = !{!68} +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !63, type: !15) +// CHECK:STDOUT: !69 = !DILocation(line: 106, column: 12, scope: !63) +// CHECK:STDOUT: !70 = !DILocation(line: 106, column: 5, scope: !63) +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.8c5449d223152401", scope: null, file: !64, line: 105, type: !65, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !72) +// CHECK:STDOUT: !72 = !{!73} +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !71, type: !15) +// CHECK:STDOUT: !74 = !DILocation(line: 106, column: 12, scope: !71) +// CHECK:STDOUT: !75 = !DILocation(line: 106, column: 5, scope: !71) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.538322f9fda4254f:ImplicitAs.a276ba298c70ba87.Core.829156f00ffa2f85", scope: null, file: !64, line: 105, type: !65, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !77) +// CHECK:STDOUT: !77 = !{!78} +// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !76, type: !15) +// CHECK:STDOUT: !79 = !DILocation(line: 106, column: 12, scope: !76) +// CHECK:STDOUT: !80 = !DILocation(line: 106, column: 5, scope: !76) +// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.9ca4a8a75282568d", scope: null, file: !64, line: 80, type: !65, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !82) +// CHECK:STDOUT: !82 = !{!83} +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !81, type: !15) +// CHECK:STDOUT: !84 = !DILocation(line: 81, column: 12, scope: !81) +// CHECK:STDOUT: !85 = !DILocation(line: 81, column: 5, scope: !81) +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.92767fefc702cdf5", scope: null, file: !64, line: 87, type: !65, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !87) +// CHECK:STDOUT: !87 = !{!88} +// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !86, type: !15) +// CHECK:STDOUT: !89 = !DILocation(line: 88, column: 29, scope: !86) +// CHECK:STDOUT: !90 = !DILocation(line: 88, column: 12, scope: !86) +// CHECK:STDOUT: !91 = !DILocation(line: 88, column: 5, scope: !86) +// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.d62727437df45535:OptionalAs.1dac4564233fecd1.Core.8f07a49808730bc0", scope: null, file: !64, line: 87, type: !65, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !93) +// CHECK:STDOUT: !93 = !{!94} +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !92, type: !15) +// CHECK:STDOUT: !95 = !DILocation(line: 88, column: 29, scope: !92) +// CHECK:STDOUT: !96 = !DILocation(line: 88, column: 12, scope: !92) +// CHECK:STDOUT: !97 = !DILocation(line: 88, column: 5, scope: !92) +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.9ca4a8a75282568d", scope: null, file: !64, line: 33, type: !65, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !99) +// CHECK:STDOUT: !99 = !{!100} +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !98, type: !15) +// CHECK:STDOUT: !101 = !DILocation(line: 34, column: 12, scope: !98) +// CHECK:STDOUT: !102 = !DILocation(line: 34, column: 5, scope: !98) +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert:thunk:ImplicitAs.d035546bf1a99743.Core:e8f8f92d3d08d149:ImplicitAs.01c4a560c986e7d1.Core.84588f41d61dafba", scope: null, file: !104, line: 40, type: !65, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !105) +// CHECK:STDOUT: !104 = !DIFile(filename: "{{.*}}/prelude/types/cpp/void.carbon", directory: "") +// CHECK:STDOUT: !105 = !{!106} +// CHECK:STDOUT: !106 = !DILocalVariable(arg: 1, scope: !103, type: !15) +// CHECK:STDOUT: !107 = !DILocation(line: 40, column: 3, scope: !103) +// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.8706aff08f648688", scope: null, file: !64, line: 33, type: !65, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !109) +// CHECK:STDOUT: !109 = !{!110} +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !108, type: !15) +// CHECK:STDOUT: !111 = !DILocation(line: 34, column: 12, scope: !108) +// CHECK:STDOUT: !112 = !DILocation(line: 34, column: 5, scope: !108) +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.7a595a06c724a271", scope: null, file: !64, line: 166, type: !65, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !114) +// CHECK:STDOUT: !114 = !{!115} +// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !113, type: !15) +// CHECK:STDOUT: !116 = !DILocation(line: 167, column: 14, scope: !113) +// CHECK:STDOUT: !117 = !DILocation(line: 169, column: 5, scope: !113) +// CHECK:STDOUT: !118 = !DILocation(line: 167, column: 18, scope: !113) +// CHECK:STDOUT: !119 = !DILocation(line: 170, column: 5, scope: !113) +// CHECK:STDOUT: !120 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.8f1054b47505c137", scope: null, file: !64, line: 166, type: !65, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !121) +// CHECK:STDOUT: !121 = !{!122} +// CHECK:STDOUT: !122 = !DILocalVariable(arg: 1, scope: !120, type: !15) +// CHECK:STDOUT: !123 = !DILocation(line: 167, column: 14, scope: !120) +// CHECK:STDOUT: !124 = !DILocation(line: 169, column: 5, scope: !120) +// CHECK:STDOUT: !125 = !DILocation(line: 167, column: 18, scope: !120) +// CHECK:STDOUT: !126 = !DILocation(line: 170, column: 5, scope: !120) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'receive.carbon' @@ -389,24 +390,24 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReceiveVoidPtr.Main() #0 !dbg !11 { +// CHECK:STDOUT: define ptr @_CReceiveVoidPtr.Main() #0 !dbg !12 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %return_void_ptr.call = call ptr @_Z15return_void_ptrv(), !dbg !15 -// CHECK:STDOUT: ret ptr %return_void_ptr.call, !dbg !16 +// CHECK:STDOUT: %return_void_ptr.call = call ptr @_Z15return_void_ptrv(), !dbg !16 +// CHECK:STDOUT: ret ptr %return_void_ptr.call, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z15return_void_ptrv() #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CConvertFromVoidPtr.Main(ptr %p) #0 !dbg !17 { +// CHECK:STDOUT: define ptr @_CConvertFromVoidPtr.Main(ptr %p) #0 !dbg !18 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr %p, !dbg !22 +// CHECK:STDOUT: ret ptr %p, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CConvertFromConstVoidPtr.Main(ptr %p) #0 !dbg !23 { +// CHECK:STDOUT: define ptr @_CConvertFromConstVoidPtr.Main(ptr %p) #0 !dbg !24 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr %p, !dbg !26 +// CHECK:STDOUT: ret ptr %p, !dbg !27 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -423,24 +424,25 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "ReceiveVoidPtr", linkageName: "_CReceiveVoidPtr.Main", scope: null, file: !1, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14} -// CHECK:STDOUT: !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !15 = !DILocation(line: 7, column: 10, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 3, scope: !11) -// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "ConvertFromVoidPtr", linkageName: "_CConvertFromVoidPtr.Main", scope: null, file: !1, line: 10, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !20) -// CHECK:STDOUT: !18 = !DISubroutineType(types: !19) -// CHECK:STDOUT: !19 = !{!14, !14} -// CHECK:STDOUT: !20 = !{!21} -// CHECK:STDOUT: !21 = !DILocalVariable(arg: 1, scope: !17, type: !14) -// CHECK:STDOUT: !22 = !DILocation(line: 11, column: 3, scope: !17) -// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "ConvertFromConstVoidPtr", linkageName: "_CConvertFromConstVoidPtr.Main", scope: null, file: !1, line: 14, type: !18, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !24) -// CHECK:STDOUT: !24 = !{!25} -// CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !23, type: !14) -// CHECK:STDOUT: !26 = !DILocation(line: 15, column: 3, scope: !23) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "ReceiveVoidPtr", linkageName: "_CReceiveVoidPtr.Main", scope: null, file: !1, line: 6, type: !13, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !13 = !DISubroutineType(types: !14) +// CHECK:STDOUT: !14 = !{!15} +// CHECK:STDOUT: !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !16 = !DILocation(line: 7, column: 10, scope: !12) +// CHECK:STDOUT: !17 = !DILocation(line: 7, column: 3, scope: !12) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "ConvertFromVoidPtr", linkageName: "_CConvertFromVoidPtr.Main", scope: null, file: !1, line: 10, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !21) +// CHECK:STDOUT: !19 = !DISubroutineType(types: !20) +// CHECK:STDOUT: !20 = !{!15, !15} +// CHECK:STDOUT: !21 = !{!22} +// CHECK:STDOUT: !22 = !DILocalVariable(arg: 1, scope: !18, type: !15) +// CHECK:STDOUT: !23 = !DILocation(line: 11, column: 3, scope: !18) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "ConvertFromConstVoidPtr", linkageName: "_CConvertFromConstVoidPtr.Main", scope: null, file: !1, line: 14, type: !19, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !25) +// CHECK:STDOUT: !25 = !{!26} +// CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !24, type: !15) +// CHECK:STDOUT: !27 = !DILocation(line: 15, column: 3, scope: !24) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/var/export.carbon b/toolchain/lower/testdata/var/export.carbon index 2d86d0278bd07..243f545a7d0d1 100644 --- a/toolchain/lower/testdata/var/export.carbon +++ b/toolchain/lower/testdata/var/export.carbon @@ -39,22 +39,22 @@ fn Run() -> i32 { // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define dso_local noundef i32 @_Z3Getv() #0 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %0 = load i32, ptr @_Cx.Main, align 4, !tbaa !7 +// CHECK:STDOUT: %0 = load i32, ptr @_Cx.Main, align 4, !tbaa !12 // CHECK:STDOUT: ret i32 %0 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @main() #1 !dbg !11 { +// CHECK:STDOUT: define i32 @main() #1 !dbg !13 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Get.call = call i32 @_Z3Getv(), !dbg !15 -// CHECK:STDOUT: ret i32 %Get.call, !dbg !16 +// CHECK:STDOUT: %Get.call = call i32 @_Z3Getv(), !dbg !17 +// CHECK:STDOUT: ret i32 %Get.call, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !17 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !19 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: store i32 poison, ptr @_Cx.Main, align 4, !dbg !20 -// CHECK:STDOUT: ret void, !dbg !21 +// CHECK:STDOUT: store i32 poison, ptr @_Cx.Main, align 4, !dbg !22 +// CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -71,19 +71,21 @@ fn Run() -> i32 { // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} // CHECK:STDOUT: !5 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !6 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !7 = !{!8, !8, i64 0} -// CHECK:STDOUT: !8 = !{!"int", !9, i64 0} -// CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0} -// CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !1, line: 13, type: !12, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !12 = !DISubroutineType(types: !13) -// CHECK:STDOUT: !13 = !{!14} -// CHECK:STDOUT: !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !15 = !DILocation(line: 14, column: 10, scope: !11) -// CHECK:STDOUT: !16 = !DILocation(line: 14, column: 3, scope: !11) -// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !18, spFlags: DISPFlagDefinition, unit: !0) -// CHECK:STDOUT: !18 = !DISubroutineType(types: !19) -// CHECK:STDOUT: !19 = !{null} -// CHECK:STDOUT: !20 = !DILocation(line: 5, column: 1, scope: !17) -// CHECK:STDOUT: !21 = !DILocation(line: 0, scope: !17) +// CHECK:STDOUT: !7 = !{!8, !9, i64 0} +// CHECK:STDOUT: !8 = !{!"__libc_errno", !9, i64 0} +// CHECK:STDOUT: !9 = !{!"int", !10, i64 0} +// CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0} +// CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !12 = !{!9, !9, i64 0} +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !1, line: 13, type: !14, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !14 = !DISubroutineType(types: !15) +// CHECK:STDOUT: !15 = !{!16} +// CHECK:STDOUT: !16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !17 = !DILocation(line: 14, column: 10, scope: !13) +// CHECK:STDOUT: !18 = !DILocation(line: 14, column: 3, scope: !13) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !1, type: !20, spFlags: DISPFlagDefinition, unit: !0) +// CHECK:STDOUT: !20 = !DISubroutineType(types: !21) +// CHECK:STDOUT: !21 = !{null} +// CHECK:STDOUT: !22 = !DILocation(line: 5, column: 1, scope: !19) +// CHECK:STDOUT: !23 = !DILocation(line: 0, scope: !19) // CHECK:STDOUT: