From a567040d77e5792c94decabe3b9c650ad3d5be5c Mon Sep 17 00:00:00 2001 From: Lucile Rose Nihlen Date: Thu, 5 Nov 2026 20:33:12 +0000 Subject: [PATCH] Update LLVM to c744694c6ae1 (#8096) Moves Carbon code away from deprecated `llvm::IRBuilder` and `llvm::PassBuilder` constructors Removes llvm patch 0002 as it landed upstream in [#234482](https://github.com/llvm/llvm-project/pull/234482) Removes llvm patch 0004 as it landed upstream in [#234485](https://github.com/llvm/llvm-project/pull/234485) Removes llvm patch 0005 as it landed upstream in [#234489](https://github.com/llvm/llvm-project/pull/234489) Removes llvm patch 0006 as it landed upstream in [#234486](https://github.com/llvm/llvm-project/pull/234486) Adds llvm patch 0013, also uploaded as an upstream PR in [#239321](https://github.com/llvm/llvm-project/pull/239321) Updates tests in lower and driver to suit changes to LLVM. --- MODULE.bazel | 9 +- ...d_Bazel_build_for_compiler_rt_fuzzer.patch | 39 - ...asic_sources_exporting_for_libunwind.patch | 64 -- ...s_exporting_for_libcxx_and_libcxxabi.patch | 236 ------ .../0006_Add_more_libc_math_excludes.patch | 37 - ...xclude_additional_libc_math_builtins.patch | 33 + toolchain/driver/compile_driver.cpp | 2 +- .../optimize/clang_no_optimize_twice.carbon | 25 +- .../driver/testdata/compile/target_cpu.carbon | 43 +- toolchain/lower/constant.cpp | 2 +- toolchain/lower/function_context.cpp | 2 +- toolchain/lower/testdata/builtins/cpp.carbon | 21 +- toolchain/lower/testdata/class/static.carbon | 15 +- .../lower/testdata/interop/cpp/array.carbon | 15 +- .../cpp/clang_code_generator_callbacks.carbon | 15 +- .../interop/cpp/class/export/class.carbon | 493 ++++++------ .../class/export/destroy_from_thunk.carbon | 17 +- .../cpp/class/export/field_imported.carbon | 15 +- .../interop/cpp/class/export/generic.carbon | 21 +- .../interop/cpp/class/export/mangle.carbon | 40 +- .../interop/cpp/class/export/method.carbon | 223 +++--- .../interop/cpp/class/import/alignment.carbon | 17 +- .../interop/cpp/class/import/base.carbon | 125 +-- .../cpp/class/import/constructor.carbon | 740 +++++++++--------- .../cpp/class/import/conversion.carbon | 261 +++--- .../cpp/class/import/copy_vs_move.carbon | 247 +++--- .../cpp/class/import/destructor.carbon | 17 +- .../interop/cpp/class/import/dynamic.carbon | 15 +- .../interop/cpp/class/import/field.carbon | 285 +++---- .../interop/cpp/class/import/inherit.carbon | 17 +- .../interop/cpp/class/import/method.carbon | 249 +++--- .../cpp/class/import/virtual_base.carbon | 17 +- .../interop/cpp/class/virtual_fn.carbon | 17 +- .../cpp/class/virtual_fn_carbon_only.carbon | 17 +- .../testdata/interop/cpp/debug_info.carbon | 21 +- .../lower/testdata/interop/cpp/enum.carbon | 689 ++++++++-------- .../testdata/interop/cpp/extern_c.carbon | 217 ++--- .../cpp/function/export/constructor.carbon | 15 +- .../cpp/function/export/default_values.carbon | 15 +- .../cpp/function/export/function.carbon | 117 +-- .../cpp/function/export/generic.carbon | 17 +- .../function/export/macho_asm_label.carbon | 188 ++--- .../cpp/function/export/multiple_files.carbon | 56 +- .../cpp/function/import/cpp_run.carbon | 21 +- .../cpp/function/import/function_decl.carbon | 298 +++---- .../import/function_in_template.carbon | 15 +- .../cpp/function/import/function_ptr.carbon | 627 +++++++-------- .../cpp/function/import/import_inline.carbon | 15 +- .../cpp/function/import/method_ptr.carbon | 205 ++--- .../cpp/function/import/parameters.carbon | 249 +++--- .../interop/cpp/function/import/return.carbon | 193 ++--- .../lower/testdata/interop/cpp/globals.carbon | 248 +++--- .../testdata/interop/cpp/issue7142.carbon | 15 +- .../lower/testdata/interop/cpp/nullptr.carbon | 17 +- .../testdata/interop/cpp/operators.carbon | 216 ++--- .../lower/testdata/interop/cpp/pointer.carbon | 589 +++++++------- .../testdata/interop/cpp/reference.carbon | 278 +++---- .../testdata/interop/cpp/share_ast.carbon | 541 ++++++------- ...td_initializer_list_pointer_pointer.carbon | 15 +- .../std_initializer_list_pointer_size.carbon | 15 +- .../testdata/interop/cpp/template.carbon | 193 ++--- .../lower/testdata/interop/cpp/thunks.carbon | 339 ++++---- .../lower/testdata/interop/cpp/void.carbon | 88 ++- toolchain/lower/testdata/var/export.carbon | 15 +- 64 files changed, 4351 insertions(+), 4567 deletions(-) delete mode 100644 bazel/llvm_project/0002_Added_Bazel_build_for_compiler_rt_fuzzer.patch delete mode 100644 bazel/llvm_project/0004_Introduce_basic_sources_exporting_for_libunwind.patch delete mode 100644 bazel/llvm_project/0005_Introduce_basic_sources_exporting_for_libcxx_and_libcxxabi.patch delete mode 100644 bazel/llvm_project/0006_Add_more_libc_math_excludes.patch create mode 100644 bazel/llvm_project/0013_Exclude_additional_libc_math_builtins.patch diff --git a/MODULE.bazel b/MODULE.bazel index a99136082b48..210435d0144b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -90,17 +90,14 @@ 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-10-08. - commit = "b08e005995ed29a2f89aa9a3f599a9d45db65523", + # HEAD as of 2026-11-02. + commit = "c744694c6ae1d12bbf7d0447b4bc91ee94a1904c", patch_cmds = ["echo \"module(name='llvm-raw')\" > MODULE.bazel"], patch_strip = 1, patches = [ "//bazel/llvm_project:0001_Patch_for_mallinfo2_when_using_Bazel_build_system.patch", - "//bazel/llvm_project:0002_Added_Bazel_build_for_compiler_rt_fuzzer.patch", - "//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:0006_Add_more_libc_math_excludes.patch", "//bazel/llvm_project:0012_Drop_dependencies_on_linux_uapi_and_pyyaml.patch", + "//bazel/llvm_project:0013_Exclude_additional_libc_math_builtins.patch", ], remote = "https://github.com/llvm/llvm-project.git", ) diff --git a/bazel/llvm_project/0002_Added_Bazel_build_for_compiler_rt_fuzzer.patch b/bazel/llvm_project/0002_Added_Bazel_build_for_compiler_rt_fuzzer.patch deleted file mode 100644 index 39d22fde195a..000000000000 --- a/bazel/llvm_project/0002_Added_Bazel_build_for_compiler_rt_fuzzer.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 20d0f1fb854d9b7ce135d08575112fc58c4c7ce7 Mon Sep 17 00:00:00 2001 -From: jonmeow -Date: Thu, 14 Sep 2023 20:31:11 +0000 -Subject: [PATCH] Add libfuzzer target to compiler-rt. - ---- - .../compiler-rt/BUILD.bazel | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel -index 90264449de76..115da4cb77f6 100644 ---- a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel -+++ b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel -@@ -57,6 +57,23 @@ cc_library( - ], - ) - -+cc_library( -+ name = "FuzzerMain", -+ srcs = glob( -+ ["lib/fuzzer/Fuzzer*.cpp"], -+ ), -+ hdrs = glob([ -+ "lib/fuzzer/Fuzzer*.h", -+ "lib/fuzzer/Fuzzer*.def", -+ ]), -+ copts = [ -+ # Not using no-sanitize=address per https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow#false-positives -+ "-fno-sanitize=memory,thread,undefined", -+ "-fsanitize-coverage=0", -+ ], -+ includes = ["lib/fuzzer"], -+) -+ - cc_library( - name = "orc_rt_common_headers", - hdrs = [ --- -2.42.0 diff --git a/bazel/llvm_project/0004_Introduce_basic_sources_exporting_for_libunwind.patch b/bazel/llvm_project/0004_Introduce_basic_sources_exporting_for_libunwind.patch deleted file mode 100644 index 7d2eadcb5419..000000000000 --- a/bazel/llvm_project/0004_Introduce_basic_sources_exporting_for_libunwind.patch +++ /dev/null @@ -1,64 +0,0 @@ -Commit ID: 354e38c89f28e2cc284e655a9cde707f457dc02c -Change ID: sxspxmonsuvqzuvxvrvorlumwpwromsv -Author : Chandler Carruth (2025-09-25 22:55:26) -Committer: Chandler Carruth (2026-02-14 03:46:06) - - Introduce basic sources exporting for libunwind - - This exports the source files directly so that they can be used to build - this runtime library on demand. - -diff --git a/utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel b/utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel -index c9fdc819c0..7d734c5a06 100644 ---- a/utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel -+++ b/utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel -@@ -21,3 +21,19 @@ - ], - strip_include_prefix = "include", - ) -+ -+filegroup( -+ name = "libunwind_hdrs", -+ srcs = glob(["include/**/*.h"]), -+) -+ -+filegroup( -+ name = "libunwind_srcs", -+ srcs = glob([ -+ "src/*.cpp", -+ "src/*.hpp", -+ "src/*.c", -+ "src/*.h", -+ "src/*.S", -+ ]), -+) -diff --git a/utils/bazel/llvm-project-overlay/libunwind/libunwind_library.bzl b/utils/bazel/llvm-project-overlay/libunwind/libunwind_library.bzl -new file mode 100644 -index 0000000000..25675d3070 ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/libunwind/libunwind_library.bzl -@@ -0,0 +1,24 @@ -+# This file is licensed under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+"""Starlark variables and macros for building libunwind. -+ -+Variables provide base line information for how to build libunwind source files. -+These can be used to generate non-Bazel builds of the library. -+ -+Macros provide a convenient way to construct Bazel `cc_library` rules for -+libunwind. -+""" -+ -+# TODO: Should libunwind use `-fvisibility-inlines-hidden` and -+# `-fvisibility=hidden`, similar to libc++? -+libunwind_copts = [ -+ "-D_LIBUNWIND_IS_NATIVE_ONLY", -+ "-O3", -+ "-fPIC", -+ "-fno-exceptions", -+ "-fno-rtti", -+ "-funwind-tables", -+ "-nostdinc++", -+] diff --git a/bazel/llvm_project/0005_Introduce_basic_sources_exporting_for_libcxx_and_libcxxabi.patch b/bazel/llvm_project/0005_Introduce_basic_sources_exporting_for_libcxx_and_libcxxabi.patch deleted file mode 100644 index a1f9b6c2bf88..000000000000 --- a/bazel/llvm_project/0005_Introduce_basic_sources_exporting_for_libcxx_and_libcxxabi.patch +++ /dev/null @@ -1,236 +0,0 @@ -Commit ID: 1fd710ed69a0f47f454c386d39302ddb756a88b3 -Change ID: mstnwoqruyypnoouksnyqssllrsozpos -Bookmarks: bz-libcxx* bz-libcxx@git -Author : Chandler Carruth (2025-09-25 22:55:26) -Committer: Chandler Carruth (2026-03-08 07:41:54) - - Introduce basic sources exporting for libcxx and libcxxabi - - This exports the source files directly so that they can be used to build - a libcxx runtime library on demand. It also differentiates between - normal sources and textual sources. - -diff --git a/utils/bazel/llvm-project-overlay/libcxx/BUILD.bazel b/utils/bazel/llvm-project-overlay/libcxx/BUILD.bazel -new file mode 100644 -index 0000000000..c8b517ab56 ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/libcxx/BUILD.bazel -@@ -0,0 +1,139 @@ -+# This file is licensed under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+licenses(["notice"]) -+ -+package( -+ default_visibility = ["//visibility:public"], -+) -+ -+exports_files([ -+ "include/__config_site.in", -+ "include/module.modulemap.in", -+ "vendor/llvm/default_assertion_handler.in", -+]) -+ -+filegroup( -+ name = "libcxx_hdrs", -+ srcs = glob( -+ [ -+ # Top level includes and those in `experimental` and `ext` sometimes -+ # have no extension. -+ "include/*", -+ "include/experimental/*", -+ "include/ext/*", -+ -+ # Implementation detail headers all use `.h` extensions -+ "include/**/*.h", -+ ], -+ exclude = [ -+ # Omit CMake and CMake-configured files that get caught by the -+ # extension-less patterns. -+ "**/*.in", -+ "**/CMakeLists.txt", -+ -+ # Omit C++03 compatibility headers as current users don't need them. -+ "include/__cxx03/**", -+ ], -+ ), -+) -+ -+LIBCXX_SRCS_PSTL_LIBDISPATCH = [ -+ "src/pstl/libdispatch.cpp", -+] -+ -+filegroup( -+ name = "libcxx_srcs_pstl_libdispatch", -+ srcs = LIBCXX_SRCS_PSTL_LIBDISPATCH, -+) -+ -+LIBCXX_SRCS_SUPPORT_IBM_PATTERNS = [ -+ "src/support/ibm/**/*.cpp", -+] -+ -+filegroup( -+ name = "libcxx_srcs_support_ibm", -+ srcs = glob(LIBCXX_SRCS_SUPPORT_IBM_PATTERNS), -+) -+ -+LIBCXX_SRCS_SUPPORT_WIN32_PATTERNS = [ -+ "src/support/win32/**/*.cpp", -+] -+ -+filegroup( -+ name = "libcxx_srcs_support_win32", -+ srcs = glob(LIBCXX_SRCS_SUPPORT_WIN32_PATTERNS), -+) -+ -+LIBCXX_SRCS_TZDB = [ -+ "src/experimental/chrono_exception.cpp", -+ "src/experimental/time_zone.cpp", -+ "src/experimental/tzdb.cpp", -+ "src/experimental/tzdb_list.cpp", -+] -+ -+filegroup( -+ name = "libcxx_srcs_tzdb", -+ srcs = LIBCXX_SRCS_TZDB, -+) -+ -+# Exclude platform-dependent patterns that are provided by per-target filegroups -+# above. -+LIBCXX_SRCS_TARGET_EXCLUDES = ( -+ LIBCXX_SRCS_PSTL_LIBDISPATCH + -+ LIBCXX_SRCS_SUPPORT_IBM_PATTERNS + -+ LIBCXX_SRCS_SUPPORT_WIN32_PATTERNS + -+ LIBCXX_SRCS_TZDB -+) -+ -+filegroup( -+ name = "libcxx_srcs_generic", -+ srcs = glob( -+ [ -+ "src/**/*.cpp", -+ "src/**/*.h", -+ "src/**/*.ipp", -+ ], -+ exclude = [ -+ # Build is for use with libc++abi and so don't need 'new.cpp'. -+ "src/new.cpp", -+ -+ # Build is for compiler-rt platforms so we have its int128 support. -+ "src/filesystem/int128_builtins.cpp", -+ ] + LIBCXX_SRCS_TARGET_EXCLUDES, -+ ), -+) -+ -+filegroup( -+ name = "libcxx_linux_srcs", -+ srcs = [ -+ ":libcxx_srcs_generic", -+ ":libcxx_srcs_tzdb", -+ ], -+) -+ -+filegroup( -+ name = "libcxx_macos_srcs", -+ srcs = [ -+ ":libcxx_srcs_generic", -+ # TODO: Include libdispatch sources here to enable that pstl backend. -+ ], -+) -+ -+filegroup( -+ name = "libcxx_win32_srcs", -+ srcs = [ -+ ":libcxx_srcs_generic", -+ ":libcxx_srcs_support_win32", -+ ], -+) -+ -+filegroup( -+ name = "libcxx_all_srcs", -+ srcs = [ -+ ":libcxx_linux_srcs", -+ ":libcxx_macos_srcs", -+ ":libcxx_win32_srcs", -+ ], -+) -diff --git a/utils/bazel/llvm-project-overlay/libcxx/libcxx_library.bzl b/utils/bazel/llvm-project-overlay/libcxx/libcxx_library.bzl -new file mode 100644 -index 0000000000..66f64f3610 ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/libcxx/libcxx_library.bzl -@@ -0,0 +1,37 @@ -+# This file is licensed under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+"""Starlark variables and macros for building libc++ and libc++abi. -+ -+Variables provide base line information for how to build libc++ and libc++abi -+source files. These can be used to generate non-Bazel builds of the library. -+ -+TODO: Add macros that provide a convenient way to construct Bazel `cc_library` -+rules for libc++ and libc++abi. -+ -+TODO: Add either sufficient usage in the macros, or add a how-to example here in -+the documentation so the use of these variables is more clear. -+""" -+ -+_libcxx_base_copts = [ -+ "-std=c++26", -+ "-O3", -+ "-fPIC", -+ "-fvisibility-inlines-hidden", -+ "-fvisibility=hidden", -+ "-nostdinc++", -+] -+ -+_libcxx_defines = [ -+ "-D_LIBCPP_BUILDING_LIBRARY", -+ "-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES", -+] -+ -+_libcxxabi_defines = [ -+ "-DLIBCXX_BUILDING_LIBCXXABI", -+] -+ -+libcxx_copts = _libcxx_base_copts + _libcxx_defines -+libcxxabi_copts = _libcxx_base_copts + _libcxxabi_defines -+libcxx_and_abi_copts = _libcxx_base_copts + _libcxx_defines + _libcxxabi_defines -diff --git a/utils/bazel/llvm-project-overlay/libcxxabi/BUILD.bazel b/utils/bazel/llvm-project-overlay/libcxxabi/BUILD.bazel -new file mode 100644 -index 0000000000..2db70b54e2 ---- /dev/null -+++ b/utils/bazel/llvm-project-overlay/libcxxabi/BUILD.bazel -@@ -0,0 +1,30 @@ -+# This file is licensed under the Apache License v2.0 with LLVM Exceptions. -+# See https://llvm.org/LICENSE.txt for license information. -+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -+ -+licenses(["notice"]) -+ -+package( -+ default_visibility = ["//visibility:public"], -+) -+ -+filegroup( -+ name = "libcxxabi_hdrs", -+ srcs = glob(["include/*.h"]), -+) -+ -+filegroup( -+ name = "libcxxabi_srcs", -+ srcs = glob([ -+ "src/**/*.cpp", -+ "src/**/*.h", -+ ]), -+) -+ -+filegroup( -+ name = "libcxxabi_textual_srcs", -+ srcs = glob([ -+ "src/**/*.def", -+ "src/**/*.inc", -+ ]), -+) diff --git a/bazel/llvm_project/0006_Add_more_libc_math_excludes.patch b/bazel/llvm_project/0006_Add_more_libc_math_excludes.patch deleted file mode 100644 index be500e2e5e54..000000000000 --- a/bazel/llvm_project/0006_Add_more_libc_math_excludes.patch +++ /dev/null @@ -1,37 +0,0 @@ -Removes additional libc-backed arithmetic builtins added -by https://github.com/llvm/llvm-project/pull/207092 -and https://github.com/llvm/llvm-project/pull/209984 ---- ---- a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel -+++ b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel -@@ -303,6 +303,30 @@ - "lib/builtins/extendsfdf2.cpp", - "lib/builtins/extendsftf2.cpp", - "lib/builtins/extendxftf2.cpp", -+ "lib/builtins/fixdfdi.cpp", -+ "lib/builtins/fixdfsi.cpp", -+ "lib/builtins/fixdfti.cpp", -+ "lib/builtins/fixsfdi.cpp", -+ "lib/builtins/fixsfsi.cpp", -+ "lib/builtins/fixsfti.cpp", -+ "lib/builtins/fixunsdfdi.cpp", -+ "lib/builtins/fixunsdfsi.cpp", -+ "lib/builtins/fixunsdfti.cpp", -+ "lib/builtins/fixunssfdi.cpp", -+ "lib/builtins/fixunssfsi.cpp", -+ "lib/builtins/fixunssfti.cpp", -+ "lib/builtins/floatdidf.cpp", -+ "lib/builtins/floatdisf.cpp", -+ "lib/builtins/floatsidf.cpp", -+ "lib/builtins/floatsisf.cpp", -+ "lib/builtins/floattidf.cpp", -+ "lib/builtins/floattisf.cpp", -+ "lib/builtins/floatundidf.cpp", -+ "lib/builtins/floatundisf.cpp", -+ "lib/builtins/floatunsidf.cpp", -+ "lib/builtins/floatunsisf.cpp", -+ "lib/builtins/floatuntidf.cpp", -+ "lib/builtins/floatuntisf.cpp", - "lib/builtins/muldf3.cpp", - "lib/builtins/mulsf3.cpp", - "lib/builtins/multf3.cpp", diff --git a/bazel/llvm_project/0013_Exclude_additional_libc_math_builtins.patch b/bazel/llvm_project/0013_Exclude_additional_libc_math_builtins.patch new file mode 100644 index 000000000000..7b9ae05f6740 --- /dev/null +++ b/bazel/llvm_project/0013_Exclude_additional_libc_math_builtins.patch @@ -0,0 +1,33 @@ +diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel +index 2f3eeb68dd..16d3c92349 100644 +--- a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel ++++ b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel +@@ -317,12 +317,15 @@ BUILTINS_LIBC_MATH_EXCLUDES = [ + BUILTINS_LIBC_MATH_EXCLUDES = [ + # Sources requiring COMPILER_RT_USE_LIBC_MATH (e.g. LIBC_NAMESPACE::shared::*). + "lib/builtins/adddf3.cpp", ++ "lib/builtins/addsf3.cpp", + "lib/builtins/addtf3.cpp", +- "lib/builtins/addsf3.cpp", + "lib/builtins/divdf3.cpp", + "lib/builtins/divsf3.cpp", + "lib/builtins/divtf3.cpp", + "lib/builtins/extenddftf2.cpp", ++ "lib/builtins/extendhfdf2.cpp", ++ "lib/builtins/extendhfsf2.cpp", ++ "lib/builtins/extendhftf2.cpp", + "lib/builtins/extendsfdf2.cpp", + "lib/builtins/extendsftf2.cpp", + "lib/builtins/extendxftf2.cpp", +@@ -358,8 +361,11 @@ BUILTINS_LIBC_MATH_EXCLUDES = [ + "lib/builtins/subdf3.cpp", + "lib/builtins/subsf3.cpp", + "lib/builtins/subtf3.cpp", ++ "lib/builtins/truncdfhf2.cpp", + "lib/builtins/truncdfsf2.cpp", ++ "lib/builtins/truncsfhf2.cpp", + "lib/builtins/trunctfdf2.cpp", ++ "lib/builtins/trunctfhf2.cpp", + "lib/builtins/trunctfsf2.cpp", + "lib/builtins/trunctfxf2.cpp", + ] diff --git a/toolchain/driver/compile_driver.cpp b/toolchain/driver/compile_driver.cpp index 33f61319f07f..8396cde026d3 100644 --- a/toolchain/driver/compile_driver.cpp +++ b/toolchain/driver/compile_driver.cpp @@ -284,7 +284,7 @@ auto CompilationUnit::RunOptimize( /*DebugLogging=*/false); si.registerCallbacks(pic); - llvm::PassBuilder builder(target_machine_.get(), pto, + llvm::PassBuilder builder(module_->getContext(), target_machine_.get(), pto, /*PGOOpt=*/std::nullopt, &pic); // TODO: Add an AssignmentTrackingPass for at least `--optimize=debug`. 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 b6056636667f..0fdc347cba5c 100644 --- a/toolchain/driver/testdata/compile/optimize/clang_no_optimize_twice.carbon +++ b/toolchain/driver/testdata/compile/optimize/clang_no_optimize_twice.carbon @@ -59,8 +59,8 @@ fn Call() -> i32 { // CHECK:STDOUT: attributes #2 = { noinline nounwind optnone } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!1} -// CHECK:STDOUT: !llvm.module.flags = !{!10, !11, !12, !18, !19} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!17} +// CHECK:STDOUT: !llvm.module.flags = !{!10, !11, !12, !13, !19, !20} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!18} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !DIFile(filename: "foo.carbon", directory: "") // CHECK:STDOUT: !1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !0, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) @@ -70,14 +70,15 @@ fn Call() -> i32 { // CHECK:STDOUT: !5 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !0, line: 12, type: !4, spFlags: DISPFlagDefinition, unit: !1) // CHECK:STDOUT: !8 = !DILocation(line: 13, column: 10, scope: !5) // CHECK:STDOUT: !9 = !DILocation(line: 13, column: 3, scope: !5) -// CHECK:STDOUT: !10 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !11 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !12 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !13 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !14 = !{!"omnipotent char", !13, i64 0} -// CHECK:STDOUT: !15 = !{!"int", !14, i64 0} -// CHECK:STDOUT: !16 = !{!"__libc_errno", !15, i64 0} -// CHECK:STDOUT: !17 = !{!16, !15, i64 0} -// CHECK:STDOUT: !18 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !19 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !10 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !11 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !12 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !13 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !14 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !15 = !{!"omnipotent char", !14, i64 0} +// CHECK:STDOUT: !16 = !{!"int", !15, i64 0} +// CHECK:STDOUT: !17 = !{!"__libc_errno", !16, i64 0} +// CHECK:STDOUT: !18 = !{!17, !16, i64 0} +// CHECK:STDOUT: !19 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !20 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: diff --git a/toolchain/driver/testdata/compile/target_cpu.carbon b/toolchain/driver/testdata/compile/target_cpu.carbon index cc64d132c553..7a9f574cea08 100644 --- a/toolchain/driver/testdata/compile/target_cpu.carbon +++ b/toolchain/driver/testdata/compile/target_cpu.carbon @@ -49,7 +49,7 @@ fn VectorizedWithAvx2(a: array(i32, 65536)*) { // CHECK:STDOUT: br label %vector.body, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: vector.body: ; preds = %vector.body, %entry -// CHECK:STDOUT: %index = phi i64 [ 0, %entry ], [ %index.next.3, %vector.body ], !dbg !84 +// CHECK:STDOUT: %index = phi i64 [ 0, %entry ], [ %index.next.3, %vector.body ], !dbg !85 // CHECK:STDOUT: %0 = getelementptr inbounds nuw [4 x i8], ptr %a, i64 %index, !dbg !16 // CHECK:STDOUT: %1 = getelementptr inbounds nuw i8, ptr %0, i64 32, !dbg !16 // CHECK:STDOUT: %2 = getelementptr inbounds nuw i8, ptr %0, i64 64, !dbg !16 @@ -117,9 +117,9 @@ fn VectorizedWithAvx2(a: array(i32, 65536)*) { // CHECK:STDOUT: store <8 x i32> %32, ptr %28, align 4, !dbg !16 // CHECK:STDOUT: store <8 x i32> %33, ptr %29, align 4, !dbg !16 // CHECK:STDOUT: store <8 x i32> %34, ptr %30, align 4, !dbg !16 -// CHECK:STDOUT: %index.next.3 = add nuw nsw i64 %index, 128, !dbg !84 +// CHECK:STDOUT: %index.next.3 = add nuw nsw i64 %index, 128, !dbg !85 // CHECK:STDOUT: %35 = icmp eq i64 %index.next.3, 65536, !dbg !11 -// CHECK:STDOUT: br i1 %35, label %while.done, label %vector.body, !dbg !11, !llvm.loop !92 +// CHECK:STDOUT: br i1 %35, label %while.done, label %vector.body, !dbg !11, !llvm.loop !93 // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %vector.body // CHECK:STDOUT: ret void, !dbg !22 @@ -145,8 +145,8 @@ fn VectorizedWithAvx2(a: array(i32, 65536)*) { // CHECK:STDOUT: attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) "tune-cpu"="znver4" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!1} -// CHECK:STDOUT: !llvm.module.flags = !{!66, !67, !68, !74, !75} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!73} +// CHECK:STDOUT: !llvm.module.flags = !{!66, !67, !68, !69, !75, !76} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!74} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !DIFile(filename: "foo.carbon", directory: "") // CHECK:STDOUT: !1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !0, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) @@ -172,20 +172,21 @@ fn VectorizedWithAvx2(a: array(i32, 65536)*) { // CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !2) // CHECK:STDOUT: !43 = !DILocalVariable(arg: 2, scope: !41, type: !2) // CHECK:STDOUT: !48 = !{!42, !43} -// CHECK:STDOUT: !66 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !67 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !68 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !69 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !70 = !{!"omnipotent char", !69, i64 0} -// CHECK:STDOUT: !71 = !{!"int", !70, i64 0} -// CHECK:STDOUT: !72 = !{!"__libc_errno", !71, i64 0} -// CHECK:STDOUT: !73 = !{!72, !71, i64 0} -// CHECK:STDOUT: !74 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !75 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !82 = distinct !DILocation(line: 23, column: 5, scope: !6) -// CHECK:STDOUT: !83 = distinct !DILocation(line: 398, column: 5, scope: !25, inlinedAt: !82) -// CHECK:STDOUT: !84 = distinct !DILocation(line: 331, column: 3, scope: !41, inlinedAt: !83) -// CHECK:STDOUT: !89 = !{!"llvm.loop.isvectorized", i32 1} -// CHECK:STDOUT: !91 = !{!"llvm.loop.unroll.runtime.disable"} -// CHECK:STDOUT: !92 = distinct !{!92, !89, !91} +// CHECK:STDOUT: !66 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !67 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !68 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !69 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !70 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !71 = !{!"omnipotent char", !70, i64 0} +// CHECK:STDOUT: !72 = !{!"int", !71, i64 0} +// CHECK:STDOUT: !73 = !{!"__libc_errno", !72, i64 0} +// CHECK:STDOUT: !74 = !{!73, !72, i64 0} +// CHECK:STDOUT: !75 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !76 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !83 = distinct !DILocation(line: 23, column: 5, scope: !6) +// CHECK:STDOUT: !84 = distinct !DILocation(line: 398, column: 5, scope: !25, inlinedAt: !83) +// CHECK:STDOUT: !85 = distinct !DILocation(line: 331, column: 3, scope: !41, inlinedAt: !84) +// CHECK:STDOUT: !90 = !{!"llvm.loop.isvectorized", i32 1} +// CHECK:STDOUT: !92 = !{!"llvm.loop.unroll.runtime.disable"} +// CHECK:STDOUT: !93 = distinct !{!93, !90, !92} // CHECK:STDOUT: diff --git a/toolchain/lower/constant.cpp b/toolchain/lower/constant.cpp index 918960534e2f..1d00bd81a21d 100644 --- a/toolchain/lower/constant.cpp +++ b/toolchain/lower/constant.cpp @@ -328,7 +328,7 @@ static auto EmitAsConstant(ConstantContext& context, static auto EmitAsConstant(ConstantContext& context, SemIR::StringLiteral inst) -> llvm::Constant* { - return llvm::IRBuilder<>(context.llvm_context()) + return llvm::IRBuilder<>(context.llvm_module()) .CreateGlobalString( context.sem_ir().string_literal_values().Get(inst.string_literal_id), /*Name=*/"", /*AddressSpace=*/0, &context.llvm_module()); diff --git a/toolchain/lower/function_context.cpp b/toolchain/lower/function_context.cpp index d045f0c62163..20b97118abe9 100644 --- a/toolchain/lower/function_context.cpp +++ b/toolchain/lower/function_context.cpp @@ -27,7 +27,7 @@ FunctionContext::FunctionContext( specific_file_context_(&specific_file_context), specific_sem_ir_function_id_(specific_sem_ir_function_id), specific_id_(specific_id), - builder_(file_context.llvm_context(), llvm::ConstantFolder(), + builder_(file_context.llvm_module(), llvm::ConstantFolder(), Inserter(file_context.inst_namer())), di_subprogram_(di_subprogram), vlog_stream_(vlog_stream), diff --git a/toolchain/lower/testdata/builtins/cpp.carbon b/toolchain/lower/testdata/builtins/cpp.carbon index f121f0cdb9c4..04046800a415 100644 --- a/toolchain/lower/testdata/builtins/cpp.carbon +++ b/toolchain/lower/testdata/builtins/cpp.carbon @@ -135,8 +135,8 @@ fn Test() { // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!56, !57, !58, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!63} +// CHECK:STDOUT: !llvm.module.flags = !{!56, !57, !58, !59, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!64} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -180,12 +180,13 @@ fn Test() { // CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !6) // CHECK:STDOUT: !54 = !DILocation(line: 36, column: 1, scope: !49) // CHECK:STDOUT: !55 = !{!50} -// CHECK:STDOUT: !56 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !57 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !58 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !59 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !60 = !{!"omnipotent char", !59, i64 0} -// CHECK:STDOUT: !61 = !{!"int", !60, i64 0} -// CHECK:STDOUT: !62 = !{!"__libc_errno", !61, i64 0} -// CHECK:STDOUT: !63 = !{!62, !61, i64 0} +// CHECK:STDOUT: !56 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !57 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !58 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !59 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !60 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !61 = !{!"omnipotent char", !60, i64 0} +// CHECK:STDOUT: !62 = !{!"int", !61, i64 0} +// CHECK:STDOUT: !63 = !{!"__libc_errno", !62, i64 0} +// CHECK:STDOUT: !64 = !{!63, !62, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/static.carbon b/toolchain/lower/testdata/class/static.carbon index a84466813026..3915d35485d7 100644 --- a/toolchain/lower/testdata/class/static.carbon +++ b/toolchain/lower/testdata/class/static.carbon @@ -132,8 +132,8 @@ fn Run() -> i32 { // CHECK:STDOUT: attributes #2 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!37} -// CHECK:STDOUT: !llvm.module.flags = !{!62, !63, !64, !6, !7} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!66} +// CHECK:STDOUT: !llvm.module.flags = !{!62, !63, !64, !65, !6, !7} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!67} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -166,9 +166,10 @@ fn Run() -> i32 { // CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !38) // CHECK:STDOUT: !60 = !DILocation(line: 32, column: 1, scope: !55) // CHECK:STDOUT: !61 = !{!56} -// CHECK:STDOUT: !62 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !63 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !64 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !65 = !{!"__libc_errno", !2, i64 0} -// CHECK:STDOUT: !66 = !{!65, !2, i64 0} +// CHECK:STDOUT: !62 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !63 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !64 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !65 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !66 = !{!"__libc_errno", !2, i64 0} +// CHECK:STDOUT: !67 = !{!66, !2, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/array.carbon b/toolchain/lower/testdata/interop/cpp/array.carbon index c32a3221a28b..b31b130ed1d0 100644 --- a/toolchain/lower/testdata/interop/cpp/array.carbon +++ b/toolchain/lower/testdata/interop/cpp/array.carbon @@ -101,8 +101,8 @@ int H() { // CHECK:STDOUT: attributes #4 = { nounwind "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!25} -// CHECK:STDOUT: !llvm.module.flags = !{!51, !52, !53, !6, !7} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!55} +// CHECK:STDOUT: !llvm.module.flags = !{!51, !52, !53, !54, !6, !7} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!56} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -134,9 +134,10 @@ int H() { // CHECK:STDOUT: !48 = !{!47, !47, i64 0} // CHECK:STDOUT: !49 = !{} // CHECK:STDOUT: !50 = !{i64 4} -// CHECK:STDOUT: !51 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !52 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !53 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !54 = !{!"__libc_errno", !45, i64 0} -// CHECK:STDOUT: !55 = !{!54, !45, i64 0} +// CHECK:STDOUT: !51 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !55 = !{!"__libc_errno", !45, i64 0} +// CHECK:STDOUT: !56 = !{!55, !45, i64 0} // 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 969e79996fc6..06a3de587669 100644 --- a/toolchain/lower/testdata/interop/cpp/clang_code_generator_callbacks.carbon +++ b/toolchain/lower/testdata/interop/cpp/clang_code_generator_callbacks.carbon @@ -129,8 +129,8 @@ void f2() { // 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!16} -// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !13, !14} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!21} +// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !20, !13, !14} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!22} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -147,9 +147,10 @@ void f2() { // CHECK:STDOUT: !14 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !15 = !DIFile(filename: "clang_code_generator_callbacks.carbon", directory: "") // CHECK:STDOUT: !16 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !15, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !17 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !18 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !19 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !20 = !{!"__libc_errno", !5, i64 0} -// CHECK:STDOUT: !21 = !{!20, !5, i64 0} +// CHECK:STDOUT: !17 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !18 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !19 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !20 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !21 = !{!"__libc_errno", !5, i64 0} +// CHECK:STDOUT: !22 = !{!21, !5, 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 882d483244ac..4d920df0edc4 100644 --- a/toolchain/lower/testdata/interop/cpp/class/export/class.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/class.carbon @@ -127,8 +127,8 @@ fn G() { // CHECK:STDOUT: attributes #1 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!36} -// CHECK:STDOUT: !llvm.module.flags = !{!43, !44, !45, !19, !20} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!47} +// CHECK:STDOUT: !llvm.module.flags = !{!43, !44, !45, !46, !19, !20} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -145,11 +145,12 @@ fn G() { // CHECK:STDOUT: !40 = distinct !DISubprogram(name: "DoIt", linkageName: "_CDoIt.Main", scope: null, file: !35, line: 15, type: !39, spFlags: DISPFlagDefinition, unit: !36) // CHECK:STDOUT: !41 = !DILocation(line: 15, column: 13, scope: !40) // CHECK:STDOUT: !42 = !DILocation(line: 15, column: 1, scope: !40) -// CHECK:STDOUT: !43 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !44 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !45 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !46 = !{!"__libc_errno", !5, i64 0} -// CHECK:STDOUT: !47 = !{!46, !5, i64 0} +// CHECK:STDOUT: !43 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !44 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !45 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !46 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !47 = !{!"__libc_errno", !5, i64 0} +// CHECK:STDOUT: !48 = !{!47, !5, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'layout.carbon' @@ -185,7 +186,7 @@ fn G() { // CHECK:STDOUT: define internal void @_ZN6Carbon4MainL11CallLayoutAEPNS0_7LayoutAE(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !139 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !140 // CHECK:STDOUT: call void @_CCallLayoutA__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -194,7 +195,7 @@ fn G() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon4Main7LayoutAD2Ev(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 !139 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !140 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.LayoutA.Main"(ptr noundef nonnull align 8 dereferenceable(12) %this1) // CHECK:STDOUT: ret void @@ -218,7 +219,7 @@ fn G() { // CHECK:STDOUT: define internal void @_ZN6Carbon4MainL11CallLayoutBEPNS0_7LayoutBE(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !141 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !142 // CHECK:STDOUT: call void @_CCallLayoutB__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -227,7 +228,7 @@ fn G() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon4Main7LayoutBD2Ev(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 !141 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !142 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.LayoutB.Main"(ptr noundef nonnull align 8 dereferenceable(16) %this1) // CHECK:STDOUT: %a = getelementptr inbounds nuw %"class.Carbon::Main::LayoutB", ptr %this1, i32 0, i32 0 @@ -251,7 +252,7 @@ fn G() { // CHECK:STDOUT: define internal void @_ZN6Carbon4MainL11CallLayoutCEPNS0_7LayoutCE(ptr noundef %0) #2 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !143 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !144 // CHECK:STDOUT: call void @_CCallLayoutC__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %.addr) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -260,7 +261,7 @@ fn G() { // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon4Main7LayoutCD2Ev(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 !143 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !144 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.LayoutC.Main"(ptr noundef nonnull align 8 dereferenceable(16) %this1) // CHECK:STDOUT: call void @_ZN6Carbon4Main7LayoutAD2Ev(ptr noundef nonnull align 8 dead_on_return(12) dereferenceable(12) %this1) #5 @@ -274,136 +275,136 @@ fn G() { // CHECK:STDOUT: declare void @_CCallLayoutC.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutA.Main"(ptr %self) #4 !dbg !53 { +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutA.Main"(ptr %self) #4 !dbg !54 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CSelfDestruct.Core.ec5c5666af23bee2(ptr %self), !dbg !55 -// CHECK:STDOUT: ret void, !dbg !55 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.ec5c5666af23bee2(ptr %self), !dbg !56 +// CHECK:STDOUT: ret void, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.7811fb2f9dc58511:core.SubobjectDestroy.Core"(ptr %self) #5 !dbg !57 { +// CHECK:STDOUT: define weak_odr void @"_COp.7811fb2f9dc58511:core.SubobjectDestroy.Core"(ptr %self) #5 !dbg !58 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_20.1.y = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %self, i32 0, i32 1, !dbg !59 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_20.1.y), !dbg !59 -// CHECK:STDOUT: %.loc6_20.4.x = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %self, i32 0, i32 0, !dbg !59 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.4f29d15a20894e9b(ptr %.loc6_20.4.x), !dbg !59 -// CHECK:STDOUT: ret void, !dbg !59 +// CHECK:STDOUT: %.loc6_20.1.y = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %self, i32 0, i32 1, !dbg !60 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_20.1.y), !dbg !60 +// CHECK:STDOUT: %.loc6_20.4.x = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %self, i32 0, i32 0, !dbg !60 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.4f29d15a20894e9b(ptr %.loc6_20.4.x), !dbg !60 +// CHECK:STDOUT: ret void, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.5a318796badc8ab7:core.SubobjectDestroy.Core"(ptr %self) #5 !dbg !63 { +// CHECK:STDOUT: define weak_odr void @"_COp.5a318796badc8ab7:core.SubobjectDestroy.Core"(ptr %self) #5 !dbg !64 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_20.1.y = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %self, i32 0, i32 1, !dbg !65 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_20.1.y), !dbg !65 -// CHECK:STDOUT: %.loc6_20.4.x = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %self, i32 0, i32 0, !dbg !65 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.4f29d15a20894e9b(ptr %.loc6_20.4.x), !dbg !65 -// CHECK:STDOUT: ret void, !dbg !65 +// CHECK:STDOUT: %.loc6_20.1.y = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %self, i32 0, i32 1, !dbg !66 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_20.1.y), !dbg !66 +// CHECK:STDOUT: %.loc6_20.4.x = getelementptr inbounds nuw <{ ptr, i32 }>, ptr %self, i32 0, i32 0, !dbg !66 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.4f29d15a20894e9b(ptr %.loc6_20.4.x), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallLayoutA__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %_) #6 !dbg !67 { +// CHECK:STDOUT: define linkonce_odr void @_CCallLayoutA__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %_) #6 !dbg !68 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc21 = load ptr, ptr %_, align 8, !dbg !69 -// CHECK:STDOUT: call void @_CCallLayoutA.Main(ptr %.loc21), !dbg !69 -// CHECK:STDOUT: ret void, !dbg !69 +// CHECK:STDOUT: %.loc21 = load ptr, ptr %_, align 8, !dbg !70 +// CHECK:STDOUT: call void @_CCallLayoutA.Main(ptr %.loc21), !dbg !70 +// CHECK:STDOUT: ret void, !dbg !70 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutB.Main"(ptr %self) #4 !dbg !71 { +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutB.Main"(ptr %self) #4 !dbg !72 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd2d442e060c7dd0(ptr %self), !dbg !73 -// CHECK:STDOUT: ret void, !dbg !73 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd2d442e060c7dd0(ptr %self), !dbg !74 +// CHECK:STDOUT: ret void, !dbg !74 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.9ec3885d851a710b:core.SubobjectDestroy.Core"(ptr %self) #5 !dbg !75 { +// CHECK:STDOUT: define weak_odr void @"_COp.9ec3885d851a710b:core.SubobjectDestroy.Core"(ptr %self) #5 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_15.1.b = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 1, !dbg !77 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc11_15.1.b), !dbg !77 -// CHECK:STDOUT: %.loc11_15.4.a = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 0, !dbg !77 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.ec5c5666af23bee2(ptr %.loc11_15.4.a), !dbg !77 -// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: %.loc11_15.1.b = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 1, !dbg !78 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc11_15.1.b), !dbg !78 +// CHECK:STDOUT: %.loc11_15.4.a = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 0, !dbg !78 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.ec5c5666af23bee2(ptr %.loc11_15.4.a), !dbg !78 +// CHECK:STDOUT: ret void, !dbg !78 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.98b9397038fd95a2:core.SubobjectDestroy.Core"(ptr %self) #5 !dbg !79 { +// CHECK:STDOUT: define weak_odr void @"_COp.98b9397038fd95a2:core.SubobjectDestroy.Core"(ptr %self) #5 !dbg !80 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_15.1.b = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 1, !dbg !81 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc11_15.1.b), !dbg !81 -// CHECK:STDOUT: %.loc11_15.4.a = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 0, !dbg !81 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.ec5c5666af23bee2(ptr %.loc11_15.4.a), !dbg !81 -// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: %.loc11_15.1.b = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 1, !dbg !82 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc11_15.1.b), !dbg !82 +// CHECK:STDOUT: %.loc11_15.4.a = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 0, !dbg !82 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.ec5c5666af23bee2(ptr %.loc11_15.4.a), !dbg !82 +// CHECK:STDOUT: ret void, !dbg !82 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallLayoutB__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %_) #6 !dbg !83 { +// CHECK:STDOUT: define linkonce_odr void @_CCallLayoutB__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %_) #6 !dbg !84 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22 = load ptr, ptr %_, align 8, !dbg !85 -// CHECK:STDOUT: call void @_CCallLayoutB.Main(ptr %.loc22), !dbg !85 -// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: %.loc22 = load ptr, ptr %_, align 8, !dbg !86 +// CHECK:STDOUT: call void @_CCallLayoutB.Main(ptr %.loc22), !dbg !86 +// CHECK:STDOUT: ret void, !dbg !86 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutC.Main"(ptr %self) #4 !dbg !87 { +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.LayoutC.Main"(ptr %self) #4 !dbg !88 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CSelfDestruct.Core.d869c4fcbd4e85a2(ptr %self), !dbg !89 -// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.d869c4fcbd4e85a2(ptr %self), !dbg !90 +// CHECK:STDOUT: ret void, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.fdd48c8f5e73335b:core.SubobjectDestroy.Core"(ptr %self) #5 !dbg !91 { +// CHECK:STDOUT: define weak_odr void @"_COp.fdd48c8f5e73335b:core.SubobjectDestroy.Core"(ptr %self) #5 !dbg !92 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc16_15.1.c = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 1, !dbg !93 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc16_15.1.c), !dbg !93 -// CHECK:STDOUT: %.loc16_15.4.base = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 0, !dbg !93 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.ec5c5666af23bee2(ptr %.loc16_15.4.base), !dbg !93 -// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: %.loc16_15.1.c = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 1, !dbg !94 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc16_15.1.c), !dbg !94 +// CHECK:STDOUT: %.loc16_15.4.base = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 0, !dbg !94 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.ec5c5666af23bee2(ptr %.loc16_15.4.base), !dbg !94 +// CHECK:STDOUT: ret void, !dbg !94 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.bb6bd82e06513595:core.SubobjectDestroy.Core"(ptr %self) #5 !dbg !95 { +// CHECK:STDOUT: define weak_odr void @"_COp.bb6bd82e06513595:core.SubobjectDestroy.Core"(ptr %self) #5 !dbg !96 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc16_15.1.c = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 1, !dbg !97 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc16_15.1.c), !dbg !97 -// CHECK:STDOUT: %.loc16_15.4.base = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 0, !dbg !97 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.ec5c5666af23bee2(ptr %.loc16_15.4.base), !dbg !97 -// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: %.loc16_15.1.c = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 1, !dbg !98 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc16_15.1.c), !dbg !98 +// CHECK:STDOUT: %.loc16_15.4.base = getelementptr inbounds nuw { <{ ptr, i32 }>, i32 }, ptr %self, i32 0, i32 0, !dbg !98 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.ec5c5666af23bee2(ptr %.loc16_15.4.base), !dbg !98 +// CHECK:STDOUT: ret void, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCallLayoutC__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %_) #6 !dbg !99 { +// CHECK:STDOUT: define linkonce_odr void @_CCallLayoutC__carbon_thunk.Main(ptr noundef nonnull align 8 dereferenceable(8) %_) #6 !dbg !100 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc23 = load ptr, ptr %_, align 8, !dbg !101 -// CHECK:STDOUT: call void @_CCallLayoutC.Main(ptr %.loc23), !dbg !101 -// CHECK:STDOUT: ret void, !dbg !101 +// CHECK:STDOUT: %.loc23 = load ptr, ptr %_, align 8, !dbg !102 +// CHECK:STDOUT: call void @_CCallLayoutC.Main(ptr %.loc23), !dbg !102 +// CHECK:STDOUT: ret void, !dbg !102 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.ec5c5666af23bee2(ptr %t) #5 !dbg !103 { -// CHECK:STDOUT: call void @"_COp.5a318796badc8ab7:core.SubobjectDestroy.Core"(ptr %t), !dbg !107 -// CHECK:STDOUT: ret void, !dbg !108 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.ec5c5666af23bee2(ptr %t) #5 !dbg !104 { +// CHECK:STDOUT: call void @"_COp.5a318796badc8ab7:core.SubobjectDestroy.Core"(ptr %t), !dbg !108 +// CHECK:STDOUT: ret void, !dbg !109 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #5 !dbg !110 { -// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #5 !dbg !111 { +// CHECK:STDOUT: ret void, !dbg !116 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.4f29d15a20894e9b(ptr %t) #5 !dbg !117 { -// CHECK:STDOUT: ret void, !dbg !122 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.4f29d15a20894e9b(ptr %t) #5 !dbg !118 { +// CHECK:STDOUT: ret void, !dbg !123 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.dd2d442e060c7dd0(ptr %t) #5 !dbg !124 { -// CHECK:STDOUT: call void @"_COp.98b9397038fd95a2:core.SubobjectDestroy.Core"(ptr %t), !dbg !128 -// CHECK:STDOUT: ret void, !dbg !129 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.dd2d442e060c7dd0(ptr %t) #5 !dbg !125 { +// CHECK:STDOUT: call void @"_COp.98b9397038fd95a2:core.SubobjectDestroy.Core"(ptr %t), !dbg !129 +// CHECK:STDOUT: ret void, !dbg !130 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.d869c4fcbd4e85a2(ptr %t) #5 !dbg !131 { -// CHECK:STDOUT: call void @"_COp.bb6bd82e06513595:core.SubobjectDestroy.Core"(ptr %t), !dbg !135 -// CHECK:STDOUT: ret void, !dbg !136 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.d869c4fcbd4e85a2(ptr %t) #5 !dbg !132 { +// CHECK:STDOUT: call void @"_COp.bb6bd82e06513595:core.SubobjectDestroy.Core"(ptr %t), !dbg !136 +// CHECK:STDOUT: ret void, !dbg !137 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -420,9 +421,9 @@ fn G() { // CHECK:STDOUT: attributes #5 = { nounwind } // CHECK:STDOUT: attributes #6 = { nounwind "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!49} -// CHECK:STDOUT: !llvm.module.flags = !{!43, !44, !45, !19, !20} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!47} +// CHECK:STDOUT: !llvm.dbg.cu = !{!50} +// CHECK:STDOUT: !llvm.module.flags = !{!43, !44, !45, !46, !19, !20} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -432,95 +433,96 @@ fn G() { // CHECK:STDOUT: !20 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !27 = !DIFile(filename: "min_prelude/parts/destroy.carbon", directory: "") // CHECK:STDOUT: !37 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !43 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !44 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !45 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !46 = !{!"__libc_errno", !5, i64 0} -// CHECK:STDOUT: !47 = !{!46, !5, i64 0} -// CHECK:STDOUT: !48 = !DIFile(filename: "layout.carbon", directory: "") -// CHECK:STDOUT: !49 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !48, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !50 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !51 = !{null, !50} -// CHECK:STDOUT: !52 = !DISubroutineType(types: !51) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutA.Main", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !56) -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !50) -// CHECK:STDOUT: !55 = !DILocation(line: 6, column: 1, scope: !53) -// CHECK:STDOUT: !56 = !{!54} -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7811fb2f9dc58511:core.SubobjectDestroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !62) -// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !50) -// CHECK:STDOUT: !59 = !DILocation(line: 6, column: 1, scope: !57) -// CHECK:STDOUT: !60 = !{null, !37} -// CHECK:STDOUT: !61 = !DISubroutineType(types: !60) -// CHECK:STDOUT: !62 = !{!58} -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a318796badc8ab7:core.SubobjectDestroy.Core", scope: null, file: !48, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !66) -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !50) -// CHECK:STDOUT: !65 = !DILocation(line: 6, column: 1, scope: !63) -// CHECK:STDOUT: !66 = !{!64} -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "CallLayoutA__carbon_thunk", linkageName: "_CCallLayoutA__carbon_thunk.Main", scope: null, file: !48, line: 21, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !70) -// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !50) -// CHECK:STDOUT: !69 = !DILocation(line: 21, column: 1, scope: !67) -// CHECK:STDOUT: !70 = !{!68} -// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutB.Main", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !74) -// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !50) -// CHECK:STDOUT: !73 = !DILocation(line: 11, column: 1, scope: !71) -// CHECK:STDOUT: !74 = !{!72} -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9ec3885d851a710b:core.SubobjectDestroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !78) -// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !50) -// CHECK:STDOUT: !77 = !DILocation(line: 11, column: 1, scope: !75) -// CHECK:STDOUT: !78 = !{!76} -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98b9397038fd95a2:core.SubobjectDestroy.Core", scope: null, file: !48, line: 11, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !82) -// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !50) -// CHECK:STDOUT: !81 = !DILocation(line: 11, column: 1, scope: !79) -// CHECK:STDOUT: !82 = !{!80} -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "CallLayoutB__carbon_thunk", linkageName: "_CCallLayoutB__carbon_thunk.Main", scope: null, file: !48, line: 22, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !86) -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !50) -// CHECK:STDOUT: !85 = !DILocation(line: 22, column: 1, scope: !83) -// CHECK:STDOUT: !86 = !{!84} -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutC.Main", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !90) -// CHECK:STDOUT: !88 = !DILocalVariable(arg: 1, scope: !87, type: !50) -// CHECK:STDOUT: !89 = !DILocation(line: 16, column: 1, scope: !87) -// CHECK:STDOUT: !90 = !{!88} -// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd48c8f5e73335b:core.SubobjectDestroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !94) -// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !50) -// CHECK:STDOUT: !93 = !DILocation(line: 16, column: 1, scope: !91) -// CHECK:STDOUT: !94 = !{!92} -// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bb6bd82e06513595:core.SubobjectDestroy.Core", scope: null, file: !48, line: 16, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !98) -// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !50) -// CHECK:STDOUT: !97 = !DILocation(line: 16, column: 1, scope: !95) -// CHECK:STDOUT: !98 = !{!96} -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "CallLayoutC__carbon_thunk", linkageName: "_CCallLayoutC__carbon_thunk.Main", scope: null, file: !48, line: 23, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !102) -// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !50) -// CHECK:STDOUT: !101 = !DILocation(line: 23, column: 1, scope: !99) -// CHECK:STDOUT: !102 = !{!100} -// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.ec5c5666af23bee2", scope: null, file: !27, line: 32, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !109) -// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !50) -// CHECK:STDOUT: !107 = !DILocation(line: 34, column: 5, scope: !103) -// CHECK:STDOUT: !108 = !DILocation(line: 32, column: 1, scope: !103) -// CHECK:STDOUT: !109 = !{!104} -// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !27, line: 32, type: !61, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !116) -// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !37) -// CHECK:STDOUT: !115 = !DILocation(line: 32, column: 1, scope: !110) -// CHECK:STDOUT: !116 = !{!111} -// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.4f29d15a20894e9b", scope: null, file: !27, line: 32, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !123) -// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !117, type: !50) -// CHECK:STDOUT: !122 = !DILocation(line: 32, column: 1, scope: !117) -// CHECK:STDOUT: !123 = !{!118} -// CHECK:STDOUT: !124 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.dd2d442e060c7dd0", scope: null, file: !27, line: 32, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !130) -// CHECK:STDOUT: !125 = !DILocalVariable(arg: 1, scope: !124, type: !50) -// CHECK:STDOUT: !128 = !DILocation(line: 34, column: 5, scope: !124) -// CHECK:STDOUT: !129 = !DILocation(line: 32, column: 1, scope: !124) -// CHECK:STDOUT: !130 = !{!125} -// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.d869c4fcbd4e85a2", scope: null, file: !27, line: 32, type: !52, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !137) -// CHECK:STDOUT: !132 = !DILocalVariable(arg: 1, scope: !131, type: !50) -// CHECK:STDOUT: !135 = !DILocation(line: 34, column: 5, scope: !131) -// CHECK:STDOUT: !136 = !DILocation(line: 32, column: 1, scope: !131) -// CHECK:STDOUT: !137 = !{!132} -// CHECK:STDOUT: !138 = !{!"p1 _ZTSN6Carbon4Main7LayoutAE", !2, i64 0} -// CHECK:STDOUT: !139 = !{!138, !138, i64 0} -// CHECK:STDOUT: !140 = !{!"p1 _ZTSN6Carbon4Main7LayoutBE", !2, i64 0} -// CHECK:STDOUT: !141 = !{!140, !140, i64 0} -// CHECK:STDOUT: !142 = !{!"p1 _ZTSN6Carbon4Main7LayoutCE", !2, i64 0} -// CHECK:STDOUT: !143 = !{!142, !142, i64 0} +// CHECK:STDOUT: !43 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !44 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !45 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !46 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !47 = !{!"__libc_errno", !5, i64 0} +// CHECK:STDOUT: !48 = !{!47, !5, i64 0} +// CHECK:STDOUT: !49 = !DIFile(filename: "layout.carbon", directory: "") +// CHECK:STDOUT: !50 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !49, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !51 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !52 = !{null, !51} +// CHECK:STDOUT: !53 = !DISubroutineType(types: !52) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutA.Main", scope: null, file: !49, line: 6, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !57) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !51) +// CHECK:STDOUT: !56 = !DILocation(line: 6, column: 1, scope: !54) +// CHECK:STDOUT: !57 = !{!55} +// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp.7811fb2f9dc58511:core.SubobjectDestroy.Core", scope: null, file: !49, line: 6, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !63) +// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !51) +// CHECK:STDOUT: !60 = !DILocation(line: 6, column: 1, scope: !58) +// CHECK:STDOUT: !61 = !{null, !37} +// CHECK:STDOUT: !62 = !DISubroutineType(types: !61) +// CHECK:STDOUT: !63 = !{!59} +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Op", linkageName: "_COp.5a318796badc8ab7:core.SubobjectDestroy.Core", scope: null, file: !49, line: 6, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !67) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !51) +// CHECK:STDOUT: !66 = !DILocation(line: 6, column: 1, scope: !64) +// CHECK:STDOUT: !67 = !{!65} +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "CallLayoutA__carbon_thunk", linkageName: "_CCallLayoutA__carbon_thunk.Main", scope: null, file: !49, line: 21, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !71) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !51) +// CHECK:STDOUT: !70 = !DILocation(line: 21, column: 1, scope: !68) +// CHECK:STDOUT: !71 = !{!69} +// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutB.Main", scope: null, file: !49, line: 11, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !75) +// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !51) +// CHECK:STDOUT: !74 = !DILocation(line: 11, column: 1, scope: !72) +// CHECK:STDOUT: !75 = !{!73} +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "Op", linkageName: "_COp.9ec3885d851a710b:core.SubobjectDestroy.Core", scope: null, file: !49, line: 11, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !79) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !51) +// CHECK:STDOUT: !78 = !DILocation(line: 11, column: 1, scope: !76) +// CHECK:STDOUT: !79 = !{!77} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "Op", linkageName: "_COp.98b9397038fd95a2:core.SubobjectDestroy.Core", scope: null, file: !49, line: 11, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !83) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !51) +// CHECK:STDOUT: !82 = !DILocation(line: 11, column: 1, scope: !80) +// CHECK:STDOUT: !83 = !{!81} +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "CallLayoutB__carbon_thunk", linkageName: "_CCallLayoutB__carbon_thunk.Main", scope: null, file: !49, line: 22, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !87) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !51) +// CHECK:STDOUT: !86 = !DILocation(line: 22, column: 1, scope: !84) +// CHECK:STDOUT: !87 = !{!85} +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.LayoutC.Main", scope: null, file: !49, line: 16, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !91) +// CHECK:STDOUT: !89 = !DILocalVariable(arg: 1, scope: !88, type: !51) +// CHECK:STDOUT: !90 = !DILocation(line: 16, column: 1, scope: !88) +// CHECK:STDOUT: !91 = !{!89} +// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "Op", linkageName: "_COp.fdd48c8f5e73335b:core.SubobjectDestroy.Core", scope: null, file: !49, line: 16, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !95) +// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !92, type: !51) +// CHECK:STDOUT: !94 = !DILocation(line: 16, column: 1, scope: !92) +// CHECK:STDOUT: !95 = !{!93} +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Op", linkageName: "_COp.bb6bd82e06513595:core.SubobjectDestroy.Core", scope: null, file: !49, line: 16, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !99) +// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !96, type: !51) +// CHECK:STDOUT: !98 = !DILocation(line: 16, column: 1, scope: !96) +// CHECK:STDOUT: !99 = !{!97} +// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "CallLayoutC__carbon_thunk", linkageName: "_CCallLayoutC__carbon_thunk.Main", scope: null, file: !49, line: 23, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !103) +// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !100, type: !51) +// CHECK:STDOUT: !102 = !DILocation(line: 23, column: 1, scope: !100) +// CHECK:STDOUT: !103 = !{!101} +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.ec5c5666af23bee2", scope: null, file: !27, line: 32, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !110) +// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !104, type: !51) +// CHECK:STDOUT: !108 = !DILocation(line: 34, column: 5, scope: !104) +// CHECK:STDOUT: !109 = !DILocation(line: 32, column: 1, scope: !104) +// CHECK:STDOUT: !110 = !{!105} +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !27, line: 32, type: !62, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !117) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !37) +// CHECK:STDOUT: !116 = !DILocation(line: 32, column: 1, scope: !111) +// CHECK:STDOUT: !117 = !{!112} +// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.4f29d15a20894e9b", scope: null, file: !27, line: 32, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !124) +// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !51) +// CHECK:STDOUT: !123 = !DILocation(line: 32, column: 1, scope: !118) +// CHECK:STDOUT: !124 = !{!119} +// CHECK:STDOUT: !125 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.dd2d442e060c7dd0", scope: null, file: !27, line: 32, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !131) +// CHECK:STDOUT: !126 = !DILocalVariable(arg: 1, scope: !125, type: !51) +// CHECK:STDOUT: !129 = !DILocation(line: 34, column: 5, scope: !125) +// CHECK:STDOUT: !130 = !DILocation(line: 32, column: 1, scope: !125) +// CHECK:STDOUT: !131 = !{!126} +// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.d869c4fcbd4e85a2", scope: null, file: !27, line: 32, type: !53, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !138) +// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !132, type: !51) +// CHECK:STDOUT: !136 = !DILocation(line: 34, column: 5, scope: !132) +// CHECK:STDOUT: !137 = !DILocation(line: 32, column: 1, scope: !132) +// CHECK:STDOUT: !138 = !{!133} +// CHECK:STDOUT: !139 = !{!"p1 _ZTSN6Carbon4Main7LayoutAE", !2, i64 0} +// CHECK:STDOUT: !140 = !{!139, !139, i64 0} +// CHECK:STDOUT: !141 = !{!"p1 _ZTSN6Carbon4Main7LayoutBE", !2, i64 0} +// CHECK:STDOUT: !142 = !{!141, !141, i64 0} +// CHECK:STDOUT: !143 = !{!"p1 _ZTSN6Carbon4Main7LayoutCE", !2, i64 0} +// CHECK:STDOUT: !144 = !{!143, !143, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'field.carbon' @@ -547,54 +549,54 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.FieldC.Main"(ptr %self) #1 !dbg !146 { +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.FieldC.Main"(ptr %self) #1 !dbg !147 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CSelfDestruct.Core.0f9f2a833d58b7bf(ptr %self), !dbg !148 -// CHECK:STDOUT: ret void, !dbg !148 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.0f9f2a833d58b7bf(ptr %self), !dbg !149 +// CHECK:STDOUT: ret void, !dbg !149 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.2508ed710019eba8:core.SubobjectDestroy.Core"(ptr %self) #2 !dbg !150 { +// CHECK:STDOUT: define weak_odr void @"_COp.2508ed710019eba8:core.SubobjectDestroy.Core"(ptr %self) #2 !dbg !151 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_14.1.b = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !152 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_14.1.b), !dbg !152 -// CHECK:STDOUT: %.loc6_14.4.a = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !152 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_14.4.a), !dbg !152 -// CHECK:STDOUT: ret void, !dbg !152 +// CHECK:STDOUT: %.loc6_14.1.b = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !153 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_14.1.b), !dbg !153 +// CHECK:STDOUT: %.loc6_14.4.a = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !153 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_14.4.a), !dbg !153 +// CHECK:STDOUT: ret void, !dbg !153 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.718874c3c75b803e:core.SubobjectDestroy.Core"(ptr %self) #2 !dbg !154 { +// CHECK:STDOUT: define weak_odr void @"_COp.718874c3c75b803e:core.SubobjectDestroy.Core"(ptr %self) #2 !dbg !155 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_14.1.b = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !156 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_14.1.b), !dbg !156 -// CHECK:STDOUT: %.loc6_14.4.a = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !156 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_14.4.a), !dbg !156 -// CHECK:STDOUT: ret void, !dbg !156 +// CHECK:STDOUT: %.loc6_14.1.b = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !157 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_14.1.b), !dbg !157 +// CHECK:STDOUT: %.loc6_14.4.a = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !157 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_14.4.a), !dbg !157 +// CHECK:STDOUT: ret void, !dbg !157 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #2 !dbg !158 { +// CHECK:STDOUT: define void @_CG.Main() #2 !dbg !159 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca { i32, i32 }, align 4, !dbg !159 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !159 -// CHECK:STDOUT: %.loc19_34.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 0, !dbg !160 -// CHECK:STDOUT: %.loc19_34.6.b = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 1, !dbg !160 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @FieldC.val.loc19_3.1, i64 8, i1 false), !dbg !159 -// CHECK:STDOUT: call void @_Z1FRN6Carbon4Main6FieldCE(ptr %c.var), !dbg !164 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.0f9f2a833d58b7bf(ptr %c.var), !dbg !159 -// CHECK:STDOUT: ret void, !dbg !165 +// CHECK:STDOUT: %c.var = alloca { i32, i32 }, align 4, !dbg !160 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !160 +// CHECK:STDOUT: %.loc19_34.3.a = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 0, !dbg !161 +// CHECK:STDOUT: %.loc19_34.6.b = getelementptr inbounds nuw { i32, i32 }, ptr %c.var, i32 0, i32 1, !dbg !161 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %c.var, ptr align 4 @FieldC.val.loc19_3.1, i64 8, i1 false), !dbg !160 +// CHECK:STDOUT: call void @_Z1FRN6Carbon4Main6FieldCE(ptr %c.var), !dbg !165 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.0f9f2a833d58b7bf(ptr %c.var), !dbg !160 +// CHECK:STDOUT: ret void, !dbg !166 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.0f9f2a833d58b7bf(ptr %t) #2 !dbg !166 { -// CHECK:STDOUT: call void @"_COp.718874c3c75b803e:core.SubobjectDestroy.Core"(ptr %t), !dbg !170 -// CHECK:STDOUT: ret void, !dbg !171 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.0f9f2a833d58b7bf(ptr %t) #2 !dbg !167 { +// CHECK:STDOUT: call void @"_COp.718874c3c75b803e:core.SubobjectDestroy.Core"(ptr %t), !dbg !171 +// CHECK:STDOUT: ret void, !dbg !172 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #2 !dbg !173 { -// CHECK:STDOUT: ret void, !dbg !178 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #2 !dbg !174 { +// CHECK:STDOUT: ret void, !dbg !179 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -612,9 +614,9 @@ fn G() { // CHECK:STDOUT: attributes #2 = { nounwind } // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!145} -// CHECK:STDOUT: !llvm.module.flags = !{!43, !44, !45, !19, !20} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!47} +// CHECK:STDOUT: !llvm.dbg.cu = !{!146} +// CHECK:STDOUT: !llvm.module.flags = !{!43, !44, !45, !46, !19, !20} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -633,42 +635,43 @@ fn G() { // CHECK:STDOUT: !37 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !38 = !{null} // CHECK:STDOUT: !39 = !DISubroutineType(types: !38) -// CHECK:STDOUT: !43 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !44 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !45 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !46 = !{!"__libc_errno", !5, i64 0} -// CHECK:STDOUT: !47 = !{!46, !5, i64 0} -// CHECK:STDOUT: !50 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !51 = !{null, !50} -// CHECK:STDOUT: !52 = !DISubroutineType(types: !51) -// CHECK:STDOUT: !60 = !{null, !37} -// CHECK:STDOUT: !61 = !DISubroutineType(types: !60) -// CHECK:STDOUT: !144 = !DIFile(filename: "field.carbon", directory: "") -// CHECK:STDOUT: !145 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !144, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !146 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.FieldC.Main", scope: null, file: !144, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !145, retainedNodes: !149) -// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !146, type: !50) -// CHECK:STDOUT: !148 = !DILocation(line: 6, column: 1, scope: !146) -// CHECK:STDOUT: !149 = !{!147} -// CHECK:STDOUT: !150 = distinct !DISubprogram(name: "Op", linkageName: "_COp.2508ed710019eba8:core.SubobjectDestroy.Core", scope: null, file: !144, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !145, retainedNodes: !153) -// CHECK:STDOUT: !151 = !DILocalVariable(arg: 1, scope: !150, type: !50) -// CHECK:STDOUT: !152 = !DILocation(line: 6, column: 1, scope: !150) -// CHECK:STDOUT: !153 = !{!151} -// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "Op", linkageName: "_COp.718874c3c75b803e:core.SubobjectDestroy.Core", scope: null, file: !144, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !145, retainedNodes: !157) -// CHECK:STDOUT: !155 = !DILocalVariable(arg: 1, scope: !154, type: !50) -// CHECK:STDOUT: !156 = !DILocation(line: 6, column: 1, scope: !154) -// CHECK:STDOUT: !157 = !{!155} -// CHECK:STDOUT: !158 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !144, line: 18, type: !39, spFlags: DISPFlagDefinition, unit: !145) -// CHECK:STDOUT: !159 = !DILocation(line: 19, column: 3, scope: !158) -// CHECK:STDOUT: !160 = !DILocation(line: 19, column: 19, scope: !158) -// CHECK:STDOUT: !164 = !DILocation(line: 20, column: 3, scope: !158) -// CHECK:STDOUT: !165 = !DILocation(line: 18, column: 1, scope: !158) -// CHECK:STDOUT: !166 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.0f9f2a833d58b7bf", scope: null, file: !27, line: 32, type: !52, spFlags: DISPFlagDefinition, unit: !145, retainedNodes: !172) -// CHECK:STDOUT: !167 = !DILocalVariable(arg: 1, scope: !166, type: !50) -// CHECK:STDOUT: !170 = !DILocation(line: 34, column: 5, scope: !166) -// CHECK:STDOUT: !171 = !DILocation(line: 32, column: 1, scope: !166) -// CHECK:STDOUT: !172 = !{!167} -// CHECK:STDOUT: !173 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !27, line: 32, type: !61, spFlags: DISPFlagDefinition, unit: !145, retainedNodes: !179) -// CHECK:STDOUT: !174 = !DILocalVariable(arg: 1, scope: !173, type: !37) -// CHECK:STDOUT: !178 = !DILocation(line: 32, column: 1, scope: !173) -// CHECK:STDOUT: !179 = !{!174} +// CHECK:STDOUT: !43 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !44 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !45 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !46 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !47 = !{!"__libc_errno", !5, i64 0} +// CHECK:STDOUT: !48 = !{!47, !5, i64 0} +// CHECK:STDOUT: !51 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !52 = !{null, !51} +// CHECK:STDOUT: !53 = !DISubroutineType(types: !52) +// CHECK:STDOUT: !61 = !{null, !37} +// CHECK:STDOUT: !62 = !DISubroutineType(types: !61) +// CHECK:STDOUT: !145 = !DIFile(filename: "field.carbon", directory: "") +// CHECK:STDOUT: !146 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !145, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.FieldC.Main", scope: null, file: !145, line: 6, type: !53, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !150) +// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !51) +// CHECK:STDOUT: !149 = !DILocation(line: 6, column: 1, scope: !147) +// CHECK:STDOUT: !150 = !{!148} +// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "Op", linkageName: "_COp.2508ed710019eba8:core.SubobjectDestroy.Core", scope: null, file: !145, line: 6, type: !53, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !154) +// CHECK:STDOUT: !152 = !DILocalVariable(arg: 1, scope: !151, type: !51) +// CHECK:STDOUT: !153 = !DILocation(line: 6, column: 1, scope: !151) +// CHECK:STDOUT: !154 = !{!152} +// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "Op", linkageName: "_COp.718874c3c75b803e:core.SubobjectDestroy.Core", scope: null, file: !145, line: 6, type: !53, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !158) +// CHECK:STDOUT: !156 = !DILocalVariable(arg: 1, scope: !155, type: !51) +// CHECK:STDOUT: !157 = !DILocation(line: 6, column: 1, scope: !155) +// CHECK:STDOUT: !158 = !{!156} +// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !145, line: 18, type: !39, spFlags: DISPFlagDefinition, unit: !146) +// CHECK:STDOUT: !160 = !DILocation(line: 19, column: 3, scope: !159) +// CHECK:STDOUT: !161 = !DILocation(line: 19, column: 19, scope: !159) +// CHECK:STDOUT: !165 = !DILocation(line: 20, column: 3, scope: !159) +// CHECK:STDOUT: !166 = !DILocation(line: 18, column: 1, scope: !159) +// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.0f9f2a833d58b7bf", scope: null, file: !27, line: 32, type: !53, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !173) +// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !51) +// CHECK:STDOUT: !171 = !DILocation(line: 34, column: 5, scope: !167) +// CHECK:STDOUT: !172 = !DILocation(line: 32, column: 1, scope: !167) +// CHECK:STDOUT: !173 = !{!168} +// CHECK:STDOUT: !174 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !27, line: 32, type: !62, spFlags: DISPFlagDefinition, unit: !146, retainedNodes: !180) +// CHECK:STDOUT: !175 = !DILocalVariable(arg: 1, scope: !174, type: !37) +// CHECK:STDOUT: !179 = !DILocation(line: 32, column: 1, scope: !174) +// CHECK:STDOUT: !180 = !{!175} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/export/destroy_from_thunk.carbon b/toolchain/lower/testdata/interop/cpp/class/export/destroy_from_thunk.carbon index f5759f0e0f5c..0d7c47818d93 100644 --- a/toolchain/lower/testdata/interop/cpp/class/export/destroy_from_thunk.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/destroy_from_thunk.carbon @@ -82,8 +82,8 @@ fn Run() { // CHECK:STDOUT: attributes #3 = { inlinehint 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!35, !36, !37, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!40} +// CHECK:STDOUT: !llvm.module.flags = !{!35, !36, !37, !38, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!41} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -112,10 +112,11 @@ fn Run() { // CHECK:STDOUT: !31 = !{!"any pointer", !30, i64 0} // CHECK:STDOUT: !32 = !{!"p1 _ZTSN6Carbon4Main1CE", !31, i64 0} // CHECK:STDOUT: !33 = !{!32, !32, i64 0} -// CHECK:STDOUT: !35 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !36 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !37 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !38 = !{!"int", !30, i64 0} -// CHECK:STDOUT: !39 = !{!"__libc_errno", !38, i64 0} -// CHECK:STDOUT: !40 = !{!39, !38, i64 0} +// CHECK:STDOUT: !35 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !36 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !37 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !38 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !39 = !{!"int", !30, i64 0} +// CHECK:STDOUT: !40 = !{!"__libc_errno", !39, i64 0} +// CHECK:STDOUT: !41 = !{!40, !39, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/export/field_imported.carbon b/toolchain/lower/testdata/interop/cpp/class/export/field_imported.carbon index f3ec13f02564..6f4461d95def 100644 --- a/toolchain/lower/testdata/interop/cpp/class/export/field_imported.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/field_imported.carbon @@ -123,8 +123,8 @@ void SetX(Carbon::Other::Point* p, int x) { p->x = x; } // CHECK:STDOUT: attributes #2 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!32} -// CHECK:STDOUT: !llvm.module.flags = !{!64, !65, !66, !12, !13} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!68} +// CHECK:STDOUT: !llvm.module.flags = !{!64, !65, !66, !67, !12, !13} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!69} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -169,9 +169,10 @@ void SetX(Carbon::Other::Point* p, int x) { p->x = x; } // CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !30) // CHECK:STDOUT: !62 = !DILocation(line: 32, column: 1, scope: !57) // CHECK:STDOUT: !63 = !{!58} -// CHECK:STDOUT: !64 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !65 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !66 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !67 = !{!"__libc_errno", !5, i64 0} -// CHECK:STDOUT: !68 = !{!67, !5, i64 0} +// CHECK:STDOUT: !64 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !65 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !66 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !67 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !68 = !{!"__libc_errno", !5, i64 0} +// CHECK:STDOUT: !69 = !{!68, !5, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/export/generic.carbon b/toolchain/lower/testdata/interop/cpp/class/export/generic.carbon index f019ff2c56a0..496f27cde794 100644 --- a/toolchain/lower/testdata/interop/cpp/class/export/generic.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/generic.carbon @@ -85,8 +85,8 @@ fn Run() { // CHECK:STDOUT: attributes #2 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!23} -// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !6, !7} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!39} +// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !35, !6, !7} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!40} // CHECK:STDOUT: // CHECK:STDOUT: !6 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !7 = !{i32 2, !"Debug Info Version", i32 3} @@ -98,12 +98,13 @@ fn Run() { // CHECK:STDOUT: !29 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !22, line: 20, type: !26, spFlags: DISPFlagDefinition, unit: !23) // CHECK:STDOUT: !30 = !DILocation(line: 21, column: 3, scope: !29) // CHECK:STDOUT: !31 = !DILocation(line: 20, column: 1, scope: !29) -// CHECK:STDOUT: !32 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !33 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !34 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !35 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !36 = !{!"omnipotent char", !35, i64 0} -// CHECK:STDOUT: !37 = !{!"int", !36, i64 0} -// CHECK:STDOUT: !38 = !{!"__libc_errno", !37, i64 0} -// CHECK:STDOUT: !39 = !{!38, !37, i64 0} +// CHECK:STDOUT: !32 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !33 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !34 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !35 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !36 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !37 = !{!"omnipotent char", !36, i64 0} +// CHECK:STDOUT: !38 = !{!"int", !37, i64 0} +// CHECK:STDOUT: !39 = !{!"__libc_errno", !38, i64 0} +// CHECK:STDOUT: !40 = !{!39, !38, i64 0} // 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 6c8bcd0ae0ec..37496a209413 100644 --- a/toolchain/lower/testdata/interop/cpp/class/export/mangle.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/mangle.carbon @@ -57,8 +57,8 @@ void f2(Carbon::Class2*) { // 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!12} -// CHECK:STDOUT: !llvm.module.flags = !{!13, !14, !15, !9, !10} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!18} +// CHECK:STDOUT: !llvm.module.flags = !{!13, !14, !15, !16, !9, !10} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!19} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -69,12 +69,13 @@ void f2(Carbon::Class2*) { // CHECK:STDOUT: !10 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !11 = !DIFile(filename: "other.carbon", directory: "") // CHECK:STDOUT: !12 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !11, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !13 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !14 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !15 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !16 = !{!"int", !1, i64 0} -// CHECK:STDOUT: !17 = !{!"__libc_errno", !16, i64 0} -// CHECK:STDOUT: !18 = !{!17, !16, i64 0} +// CHECK:STDOUT: !13 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !14 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !15 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !16 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !17 = !{!"int", !1, i64 0} +// CHECK:STDOUT: !18 = !{!"__libc_errno", !17, i64 0} +// CHECK:STDOUT: !19 = !{!18, !17, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'namespace.carbon' @@ -100,9 +101,9 @@ void f2(Carbon::Class2*) { // 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!20} -// CHECK:STDOUT: !llvm.module.flags = !{!13, !14, !15, !9, !10} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!18} +// CHECK:STDOUT: !llvm.dbg.cu = !{!21} +// CHECK:STDOUT: !llvm.module.flags = !{!13, !14, !15, !16, !9, !10} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!19} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -113,12 +114,13 @@ void f2(Carbon::Class2*) { // CHECK:STDOUT: !6 = !{!5, !5, i64 0} // CHECK:STDOUT: !9 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !10 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !13 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !14 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !15 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !16 = !{!"int", !1, i64 0} -// CHECK:STDOUT: !17 = !{!"__libc_errno", !16, i64 0} -// CHECK:STDOUT: !18 = !{!17, !16, i64 0} -// CHECK:STDOUT: !19 = !DIFile(filename: "namespace.carbon", directory: "") -// CHECK:STDOUT: !20 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !19, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !13 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !14 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !15 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !16 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !17 = !{!"int", !1, i64 0} +// CHECK:STDOUT: !18 = !{!"__libc_errno", !17, i64 0} +// CHECK:STDOUT: !19 = !{!18, !17, i64 0} +// CHECK:STDOUT: !20 = !DIFile(filename: "namespace.carbon", directory: "") +// CHECK:STDOUT: !21 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !20, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // 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 3a89f9764624..56431d06b909 100644 --- a/toolchain/lower/testdata/interop/cpp/class/export/method.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/method.carbon @@ -144,8 +144,8 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: attributes #6 = { nounwind "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!21} -// CHECK:STDOUT: !llvm.module.flags = !{!51, !52, !53, !4, !5} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!56} +// CHECK:STDOUT: !llvm.module.flags = !{!51, !52, !53, !54, !4, !5} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} // CHECK:STDOUT: // CHECK:STDOUT: !4 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !5 = !{i32 2, !"Debug Info Version", i32 3} @@ -176,12 +176,13 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: !48 = !{!"any pointer", !47, i64 0} // CHECK:STDOUT: !49 = !{!"p1 _ZTSN6Carbon4Main1AE", !48, i64 0} // CHECK:STDOUT: !50 = !{!49, !49, i64 0} -// CHECK:STDOUT: !51 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !52 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !53 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !54 = !{!"int", !47, i64 0} -// CHECK:STDOUT: !55 = !{!"__libc_errno", !54, i64 0} -// CHECK:STDOUT: !56 = !{!55, !54, i64 0} +// CHECK:STDOUT: !51 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !55 = !{!"int", !47, i64 0} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !55, i64 0} +// CHECK:STDOUT: !57 = !{!56, !55, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'method_with_args_and_return.carbon' @@ -213,8 +214,8 @@ fn CallCallF() { Cpp.CallStaticF(); } // 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 !100 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !101 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !101 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !102 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @_CF__carbon_thunk.ArgsA.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 @@ -225,7 +226,7 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN6Carbon4Main5ArgsAD2Ev(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 !100 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !101 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: call void @"_C__destroy_thunk:thunk.ArgsA.Main"(ptr noundef nonnull align 1 %this1) // CHECK:STDOUT: ret void @@ -235,37 +236,37 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: declare void @llvm.lifetime.end.p0(ptr captures(none)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CF.ArgsA.Main(ptr %self, i32 %a) #4 !dbg !66 { +// CHECK:STDOUT: define i32 @_CF.ArgsA.Main(ptr %self, i32 %a) #4 !dbg !67 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret i32 %a, !dbg !75 +// CHECK:STDOUT: ret i32 %a, !dbg !76 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.ArgsA.Main"(ptr %self) #5 !dbg !77 { +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.ArgsA.Main"(ptr %self) #5 !dbg !78 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CSelfDestruct.Core.cf5113b5b8a292cd(ptr %self), !dbg !79 -// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.cf5113b5b8a292cd(ptr %self), !dbg !80 +// CHECK:STDOUT: ret void, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF__carbon_thunk.ArgsA.Main(ptr noundef nonnull align 1 %self, ptr noundef nonnull align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) #6 !dbg !81 { +// CHECK:STDOUT: define linkonce_odr void @_CF__carbon_thunk.ArgsA.Main(ptr noundef nonnull align 1 %self, ptr noundef nonnull align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) #6 !dbg !82 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_29.2 = load i32, ptr %_, align 4, !dbg !85 -// CHECK:STDOUT: %ArgsA.F.call = call i32 @_CF.ArgsA.Main(ptr %self, i32 %.loc6_29.2), !dbg !85 -// CHECK:STDOUT: store i32 %ArgsA.F.call, ptr %_1, align 4, !dbg !85 -// CHECK:STDOUT: ret void, !dbg !85 +// CHECK:STDOUT: %.loc6_29.2 = load i32, ptr %_, align 4, !dbg !86 +// CHECK:STDOUT: %ArgsA.F.call = call i32 @_CF.ArgsA.Main(ptr %self, i32 %.loc6_29.2), !dbg !86 +// CHECK:STDOUT: store i32 %ArgsA.F.call, ptr %_1, align 4, !dbg !86 +// CHECK:STDOUT: ret void, !dbg !86 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CCallCallF.Main() #4 !dbg !87 { +// CHECK:STDOUT: define i32 @_CCallCallF.Main() #4 !dbg !88 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CallArgsF.call = call i32 @_Z9CallArgsFv(), !dbg !90 -// CHECK:STDOUT: ret i32 %CallArgsF.call, !dbg !91 +// CHECK:STDOUT: %CallArgsF.call = call i32 @_Z9CallArgsFv(), !dbg !91 +// CHECK:STDOUT: ret i32 %CallArgsF.call, !dbg !92 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.cf5113b5b8a292cd(ptr %t) #4 !dbg !92 { -// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.cf5113b5b8a292cd(ptr %t) #4 !dbg !93 { +// CHECK:STDOUT: ret void, !dbg !98 // 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" } @@ -276,9 +277,9 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: attributes #5 = { alwaysinline nounwind } // CHECK:STDOUT: attributes #6 = { nounwind "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!58} -// CHECK:STDOUT: !llvm.module.flags = !{!51, !52, !53, !4, !5} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!56} +// CHECK:STDOUT: !llvm.dbg.cu = !{!59} +// CHECK:STDOUT: !llvm.module.flags = !{!51, !52, !53, !54, !4, !5} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} // CHECK:STDOUT: // CHECK:STDOUT: !4 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !5 = !{i32 2, !"Debug Info Version", i32 3} @@ -289,46 +290,47 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: !46 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !47 = !{!"omnipotent char", !46, i64 0} // CHECK:STDOUT: !48 = !{!"any pointer", !47, i64 0} -// CHECK:STDOUT: !51 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !52 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !53 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !54 = !{!"int", !47, i64 0} -// CHECK:STDOUT: !55 = !{!"__libc_errno", !54, i64 0} -// CHECK:STDOUT: !56 = !{!55, !54, i64 0} -// CHECK:STDOUT: !57 = !DIFile(filename: "method_with_args_and_return.carbon", directory: "") -// CHECK:STDOUT: !58 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !57, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !59 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !60 = !{!59, !22, !59} -// CHECK:STDOUT: !61 = !DISubroutineType(types: !60) -// CHECK:STDOUT: !62 = !{null, !22, !59, !59} -// CHECK:STDOUT: !63 = !DISubroutineType(types: !62) -// CHECK:STDOUT: !64 = !{!59} -// CHECK:STDOUT: !65 = !DISubroutineType(types: !64) -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "F", linkageName: "_CF.ArgsA.Main", scope: null, file: !57, line: 6, type: !61, spFlags: DISPFlagDefinition, unit: !58, retainedNodes: !76) -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !22) -// CHECK:STDOUT: !68 = !DILocalVariable(arg: 2, scope: !66, type: !59) -// CHECK:STDOUT: !75 = !DILocation(line: 8, column: 5, scope: !66) -// CHECK:STDOUT: !76 = !{!67, !68} -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.ArgsA.Main", scope: null, file: !57, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !58, retainedNodes: !80) -// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !22) -// CHECK:STDOUT: !79 = !DILocation(line: 5, column: 1, scope: !77) -// CHECK:STDOUT: !80 = !{!78} -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.ArgsA.Main", scope: null, file: !57, line: 6, type: !63, spFlags: DISPFlagDefinition, unit: !58, retainedNodes: !86) -// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !22) -// CHECK:STDOUT: !83 = !DILocalVariable(arg: 2, scope: !81, type: !59) -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 3, scope: !81, type: !59) -// CHECK:STDOUT: !85 = !DILocation(line: 6, column: 3, scope: !81) -// CHECK:STDOUT: !86 = !{!82, !83, !84} -// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !57, line: 18, type: !65, spFlags: DISPFlagDefinition, unit: !58) -// CHECK:STDOUT: !90 = !DILocation(line: 18, column: 32, scope: !87) -// CHECK:STDOUT: !91 = !DILocation(line: 18, column: 25, scope: !87) -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.cf5113b5b8a292cd", scope: null, file: !12, line: 32, type: !24, spFlags: DISPFlagDefinition, unit: !58, retainedNodes: !98) -// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !92, type: !22) -// CHECK:STDOUT: !97 = !DILocation(line: 32, column: 1, scope: !92) -// CHECK:STDOUT: !98 = !{!93} -// CHECK:STDOUT: !99 = !{!"p1 _ZTSN6Carbon4Main5ArgsAE", !48, i64 0} -// CHECK:STDOUT: !100 = !{!99, !99, i64 0} -// CHECK:STDOUT: !101 = !{!54, !54, i64 0} +// CHECK:STDOUT: !51 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !55 = !{!"int", !47, i64 0} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !55, i64 0} +// CHECK:STDOUT: !57 = !{!56, !55, i64 0} +// CHECK:STDOUT: !58 = !DIFile(filename: "method_with_args_and_return.carbon", directory: "") +// CHECK:STDOUT: !59 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !58, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !60 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !61 = !{!60, !22, !60} +// CHECK:STDOUT: !62 = !DISubroutineType(types: !61) +// CHECK:STDOUT: !63 = !{null, !22, !60, !60} +// CHECK:STDOUT: !64 = !DISubroutineType(types: !63) +// CHECK:STDOUT: !65 = !{!60} +// CHECK:STDOUT: !66 = !DISubroutineType(types: !65) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "F", linkageName: "_CF.ArgsA.Main", scope: null, file: !58, line: 6, type: !62, spFlags: DISPFlagDefinition, unit: !59, retainedNodes: !77) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !22) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 2, scope: !67, type: !60) +// CHECK:STDOUT: !76 = !DILocation(line: 8, column: 5, scope: !67) +// CHECK:STDOUT: !77 = !{!68, !69} +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.ArgsA.Main", scope: null, file: !58, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !59, retainedNodes: !81) +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !22) +// CHECK:STDOUT: !80 = !DILocation(line: 5, column: 1, scope: !78) +// CHECK:STDOUT: !81 = !{!79} +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.ArgsA.Main", scope: null, file: !58, line: 6, type: !64, spFlags: DISPFlagDefinition, unit: !59, retainedNodes: !87) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !22) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 2, scope: !82, type: !60) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 3, scope: !82, type: !60) +// CHECK:STDOUT: !86 = !DILocation(line: 6, column: 3, scope: !82) +// CHECK:STDOUT: !87 = !{!83, !84, !85} +// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !58, line: 18, type: !66, spFlags: DISPFlagDefinition, unit: !59) +// CHECK:STDOUT: !91 = !DILocation(line: 18, column: 32, scope: !88) +// CHECK:STDOUT: !92 = !DILocation(line: 18, column: 25, scope: !88) +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.cf5113b5b8a292cd", scope: null, file: !12, line: 32, type: !24, spFlags: DISPFlagDefinition, unit: !59, retainedNodes: !99) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !22) +// CHECK:STDOUT: !98 = !DILocation(line: 32, column: 1, scope: !93) +// CHECK:STDOUT: !99 = !{!94} +// CHECK:STDOUT: !100 = !{!"p1 _ZTSN6Carbon4Main5ArgsAE", !48, i64 0} +// CHECK:STDOUT: !101 = !{!100, !100, i64 0} +// CHECK:STDOUT: !102 = !{!55, !55, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'static.carbon' @@ -351,35 +353,35 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.StaticA.Main() #2 !dbg !106 { +// CHECK:STDOUT: define void @_CF.StaticA.Main() #2 !dbg !107 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !107 +// CHECK:STDOUT: ret void, !dbg !108 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.StaticA.Main"(ptr %self) #3 !dbg !108 { +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.StaticA.Main"(ptr %self) #3 !dbg !109 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CSelfDestruct.Core.6cfb2148c863a5b2(ptr %self), !dbg !110 -// CHECK:STDOUT: ret void, !dbg !110 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.6cfb2148c863a5b2(ptr %self), !dbg !111 +// CHECK:STDOUT: ret void, !dbg !111 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF__carbon_thunk.StaticA.Main() #4 !dbg !112 { +// CHECK:STDOUT: define linkonce_odr void @_CF__carbon_thunk.StaticA.Main() #4 !dbg !113 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.StaticA.Main(), !dbg !113 -// CHECK:STDOUT: ret void, !dbg !113 +// CHECK:STDOUT: call void @_CF.StaticA.Main(), !dbg !114 +// CHECK:STDOUT: ret void, !dbg !114 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallCallF.Main() #2 !dbg !114 { +// CHECK:STDOUT: define void @_CCallCallF.Main() #2 !dbg !115 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z11CallStaticFv(), !dbg !115 -// CHECK:STDOUT: ret void, !dbg !116 +// CHECK:STDOUT: call void @_Z11CallStaticFv(), !dbg !116 +// CHECK:STDOUT: ret void, !dbg !117 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.6cfb2148c863a5b2(ptr %t) #2 !dbg !117 { -// CHECK:STDOUT: ret void, !dbg !122 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.6cfb2148c863a5b2(ptr %t) #2 !dbg !118 { +// CHECK:STDOUT: ret void, !dbg !123 // 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" } @@ -388,9 +390,9 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: attributes #3 = { alwaysinline nounwind } // CHECK:STDOUT: attributes #4 = { nounwind "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!103} -// CHECK:STDOUT: !llvm.module.flags = !{!51, !52, !53, !4, !5} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!56} +// CHECK:STDOUT: !llvm.dbg.cu = !{!104} +// CHECK:STDOUT: !llvm.module.flags = !{!51, !52, !53, !54, !4, !5} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} // CHECK:STDOUT: // CHECK:STDOUT: !4 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !5 = !{i32 2, !"Debug Info Version", i32 3} @@ -400,29 +402,30 @@ fn CallCallF() { Cpp.CallStaticF(); } // CHECK:STDOUT: !24 = !DISubroutineType(types: !23) // CHECK:STDOUT: !46 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !47 = !{!"omnipotent char", !46, i64 0} -// CHECK:STDOUT: !51 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !52 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !53 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !54 = !{!"int", !47, i64 0} -// CHECK:STDOUT: !55 = !{!"__libc_errno", !54, i64 0} -// CHECK:STDOUT: !56 = !{!55, !54, i64 0} -// CHECK:STDOUT: !102 = !DIFile(filename: "static.carbon", directory: "") -// CHECK:STDOUT: !103 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !102, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !104 = !{null} -// CHECK:STDOUT: !105 = !DISubroutineType(types: !104) -// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "F", linkageName: "_CF.StaticA.Main", scope: null, file: !102, line: 6, type: !105, spFlags: DISPFlagDefinition, unit: !103) -// CHECK:STDOUT: !107 = !DILocation(line: 6, column: 3, scope: !106) -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.StaticA.Main", scope: null, file: !102, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !103, retainedNodes: !111) -// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !108, type: !22) -// CHECK:STDOUT: !110 = !DILocation(line: 5, column: 1, scope: !108) -// CHECK:STDOUT: !111 = !{!109} -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.StaticA.Main", scope: null, file: !102, line: 6, type: !105, spFlags: DISPFlagDefinition, unit: !103) -// CHECK:STDOUT: !113 = !DILocation(line: 6, column: 3, scope: !112) -// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !102, line: 15, type: !105, spFlags: DISPFlagDefinition, unit: !103) -// CHECK:STDOUT: !115 = !DILocation(line: 15, column: 18, scope: !114) -// CHECK:STDOUT: !116 = !DILocation(line: 15, column: 1, scope: !114) -// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.6cfb2148c863a5b2", scope: null, file: !12, line: 32, type: !24, spFlags: DISPFlagDefinition, unit: !103, retainedNodes: !123) -// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !117, type: !22) -// CHECK:STDOUT: !122 = !DILocation(line: 32, column: 1, scope: !117) -// CHECK:STDOUT: !123 = !{!118} +// CHECK:STDOUT: !51 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !55 = !{!"int", !47, i64 0} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !55, i64 0} +// CHECK:STDOUT: !57 = !{!56, !55, i64 0} +// CHECK:STDOUT: !103 = !DIFile(filename: "static.carbon", directory: "") +// CHECK:STDOUT: !104 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !103, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !105 = !{null} +// CHECK:STDOUT: !106 = !DISubroutineType(types: !105) +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "F", linkageName: "_CF.StaticA.Main", scope: null, file: !103, line: 6, type: !106, spFlags: DISPFlagDefinition, unit: !104) +// CHECK:STDOUT: !108 = !DILocation(line: 6, column: 3, scope: !107) +// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.StaticA.Main", scope: null, file: !103, line: 5, type: !24, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !112) +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !22) +// CHECK:STDOUT: !111 = !DILocation(line: 5, column: 1, scope: !109) +// CHECK:STDOUT: !112 = !{!110} +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.StaticA.Main", scope: null, file: !103, line: 6, type: !106, spFlags: DISPFlagDefinition, unit: !104) +// CHECK:STDOUT: !114 = !DILocation(line: 6, column: 3, scope: !113) +// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "CallCallF", linkageName: "_CCallCallF.Main", scope: null, file: !103, line: 15, type: !106, spFlags: DISPFlagDefinition, unit: !104) +// CHECK:STDOUT: !116 = !DILocation(line: 15, column: 18, scope: !115) +// CHECK:STDOUT: !117 = !DILocation(line: 15, column: 1, scope: !115) +// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.6cfb2148c863a5b2", scope: null, file: !12, line: 32, type: !24, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !124) +// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !22) +// CHECK:STDOUT: !123 = !DILocation(line: 32, column: 1, scope: !118) +// CHECK:STDOUT: !124 = !{!119} // 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 a6707decac87..7a0d911a17a4 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/alignment.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/alignment.carbon @@ -201,8 +201,8 @@ fn Packed(n: i32) { // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!35} -// CHECK:STDOUT: !llvm.module.flags = !{!134, !135, !136, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!139} +// CHECK:STDOUT: !llvm.module.flags = !{!134, !135, !136, !137, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!140} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -275,10 +275,11 @@ fn Packed(n: i32) { // CHECK:STDOUT: !131 = !{!130, !130, i64 0} // CHECK:STDOUT: !132 = !{!"p1 _ZTS6Packed", !127, i64 0} // CHECK:STDOUT: !133 = !{!132, !132, i64 0} -// CHECK:STDOUT: !134 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !135 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !136 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !137 = !{!"int", !126, i64 0} -// CHECK:STDOUT: !138 = !{!"__libc_errno", !137, i64 0} -// CHECK:STDOUT: !139 = !{!138, !137, i64 0} +// CHECK:STDOUT: !134 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !135 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !136 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !137 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !138 = !{!"int", !126, i64 0} +// CHECK:STDOUT: !139 = !{!"__libc_errno", !138, i64 0} +// CHECK:STDOUT: !140 = !{!139, !138, i64 0} // 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 20e6fec40183..dd45b5e5ff39 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/base.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/base.carbon @@ -84,8 +84,8 @@ fn Call(b: Cpp.B*) { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!41, !42, !43, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} +// CHECK:STDOUT: !llvm.module.flags = !{!41, !42, !43, !44, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -106,14 +106,15 @@ fn Call(b: Cpp.B*) { // CHECK:STDOUT: !38 = !DILocation(line: 13, column: 3, scope: !34) // CHECK:STDOUT: !39 = !DILocation(line: 12, column: 1, scope: !34) // CHECK:STDOUT: !40 = !{!35} -// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !44 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !45 = !{!"omnipotent char", !44, i64 0} -// CHECK:STDOUT: !46 = !{!"int", !45, i64 0} -// CHECK:STDOUT: !47 = !{!"__libc_errno", !46, i64 0} -// CHECK:STDOUT: !48 = !{!47, !46, i64 0} +// CHECK:STDOUT: !41 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !42 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !43 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !44 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !45 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !46 = !{!"omnipotent char", !45, i64 0} +// CHECK:STDOUT: !47 = !{!"int", !46, i64 0} +// CHECK:STDOUT: !48 = !{!"__libc_errno", !47, i64 0} +// CHECK:STDOUT: !49 = !{!48, !47, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'access_field.carbon' @@ -122,41 +123,42 @@ 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 !53 { +// CHECK:STDOUT: define i32 @_CAccessVal.Main(ptr %b) #0 !dbg !54 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_11.1.base = getelementptr inbounds nuw [8 x i8], ptr %b, i32 0, i32 0, !dbg !58 -// CHECK:STDOUT: %.loc7_11.3.a = getelementptr inbounds nuw [4 x i8], ptr %.loc7_11.1.base, i32 0, i32 0, !dbg !58 -// CHECK:STDOUT: %.loc7_11.4 = load i32, ptr %.loc7_11.3.a, align 4, !dbg !58 -// CHECK:STDOUT: ret i32 %.loc7_11.4, !dbg !59 +// CHECK:STDOUT: %.loc7_11.1.base = getelementptr inbounds nuw [8 x i8], ptr %b, i32 0, i32 0, !dbg !59 +// CHECK:STDOUT: %.loc7_11.3.a = getelementptr inbounds nuw [4 x i8], ptr %.loc7_11.1.base, i32 0, i32 0, !dbg !59 +// CHECK:STDOUT: %.loc7_11.4 = load i32, ptr %.loc7_11.3.a, align 4, !dbg !59 +// CHECK:STDOUT: ret i32 %.loc7_11.4, !dbg !60 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!50} -// CHECK:STDOUT: !llvm.module.flags = !{!41, !42, !43, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} +// CHECK:STDOUT: !llvm.dbg.cu = !{!51} +// CHECK:STDOUT: !llvm.module.flags = !{!41, !42, !43, !44, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) // CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !44 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !45 = !{!"omnipotent char", !44, i64 0} -// CHECK:STDOUT: !46 = !{!"int", !45, i64 0} -// CHECK:STDOUT: !47 = !{!"__libc_errno", !46, i64 0} -// CHECK:STDOUT: !48 = !{!47, !46, i64 0} -// CHECK:STDOUT: !49 = !DIFile(filename: "access_field.carbon", directory: "") -// CHECK:STDOUT: !50 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !49, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !51 = !{!20, !21} -// CHECK:STDOUT: !52 = !DISubroutineType(types: !51) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "AccessVal", linkageName: "_CAccessVal.Main", scope: null, file: !49, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !60) -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !21) -// CHECK:STDOUT: !58 = !DILocation(line: 7, column: 10, scope: !53) -// CHECK:STDOUT: !59 = !DILocation(line: 7, column: 3, scope: !53) -// CHECK:STDOUT: !60 = !{!54} +// CHECK:STDOUT: !41 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !42 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !43 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !44 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !45 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !46 = !{!"omnipotent char", !45, i64 0} +// CHECK:STDOUT: !47 = !{!"int", !46, i64 0} +// CHECK:STDOUT: !48 = !{!"__libc_errno", !47, i64 0} +// CHECK:STDOUT: !49 = !{!48, !47, i64 0} +// CHECK:STDOUT: !50 = !DIFile(filename: "access_field.carbon", directory: "") +// CHECK:STDOUT: !51 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !50, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !52 = !{!20, !21} +// CHECK:STDOUT: !53 = !DISubroutineType(types: !52) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "AccessVal", linkageName: "_CAccessVal.Main", scope: null, file: !50, line: 6, type: !53, spFlags: DISPFlagDefinition, unit: !51, retainedNodes: !61) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !21) +// CHECK:STDOUT: !59 = !DILocation(line: 7, column: 10, scope: !54) +// CHECK:STDOUT: !60 = !DILocation(line: 7, column: 3, scope: !54) +// CHECK:STDOUT: !61 = !{!55} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_method.carbon' @@ -167,18 +169,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 !63 { +// CHECK:STDOUT: define void @_CCall.Main(ptr %b) #0 !dbg !64 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_4.2.base = getelementptr inbounds nuw [8 x i8], ptr %b, i32 0, i32 0, !dbg !66 -// CHECK:STDOUT: call void @_ZN1A1fEv(ptr %.loc7_4.2.base), !dbg !66 -// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: %.loc7_4.2.base = getelementptr inbounds nuw [8 x i8], ptr %b, i32 0, i32 0, !dbg !67 +// CHECK:STDOUT: call void @_ZN1A1fEv(ptr %.loc7_4.2.base), !dbg !67 +// CHECK:STDOUT: ret void, !dbg !68 // 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 !71 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !72 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -186,31 +188,32 @@ fn Call(b: Cpp.B*) { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!62} -// CHECK:STDOUT: !llvm.module.flags = !{!41, !42, !43, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} +// CHECK:STDOUT: !llvm.dbg.cu = !{!63} +// CHECK:STDOUT: !llvm.module.flags = !{!41, !42, !43, !44, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !24 = !{null, !21} // CHECK:STDOUT: !25 = !DISubroutineType(types: !24) -// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !44 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !45 = !{!"omnipotent char", !44, i64 0} -// CHECK:STDOUT: !46 = !{!"int", !45, i64 0} -// CHECK:STDOUT: !47 = !{!"__libc_errno", !46, i64 0} -// CHECK:STDOUT: !48 = !{!47, !46, i64 0} -// CHECK:STDOUT: !61 = !DIFile(filename: "call_method.carbon", directory: "") -// CHECK:STDOUT: !62 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !61, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !61, line: 6, type: !25, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !68) -// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !21) -// CHECK:STDOUT: !66 = !DILocation(line: 7, column: 3, scope: !63) -// CHECK:STDOUT: !67 = !DILocation(line: 6, column: 1, scope: !63) -// CHECK:STDOUT: !68 = !{!64} -// CHECK:STDOUT: !69 = !{!"any pointer", !45, i64 0} -// CHECK:STDOUT: !70 = !{!"p1 _ZTS1A", !69, i64 0} -// CHECK:STDOUT: !71 = !{!70, !70, i64 0} +// CHECK:STDOUT: !41 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !42 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !43 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !44 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !45 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !46 = !{!"omnipotent char", !45, i64 0} +// CHECK:STDOUT: !47 = !{!"int", !46, i64 0} +// CHECK:STDOUT: !48 = !{!"__libc_errno", !47, i64 0} +// CHECK:STDOUT: !49 = !{!48, !47, i64 0} +// CHECK:STDOUT: !62 = !DIFile(filename: "call_method.carbon", directory: "") +// CHECK:STDOUT: !63 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !62, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !62, line: 6, type: !25, spFlags: DISPFlagDefinition, unit: !63, retainedNodes: !69) +// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !21) +// CHECK:STDOUT: !67 = !DILocation(line: 7, column: 3, scope: !64) +// CHECK:STDOUT: !68 = !DILocation(line: 6, column: 1, scope: !64) +// CHECK:STDOUT: !69 = !{!65} +// CHECK:STDOUT: !70 = !{!"any pointer", !46, i64 0} +// CHECK:STDOUT: !71 = !{!"p1 _ZTS1A", !70, i64 0} +// CHECK:STDOUT: !72 = !{!71, !71, 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 debce3d37855..2fa80d74fa57 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon @@ -248,8 +248,8 @@ fn Four() { // CHECK:STDOUT: attributes #3 = { 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!56} +// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !55, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -280,11 +280,12 @@ fn Four() { // CHECK:STDOUT: !49 = !{!"_ZTS1C", !48, i64 0, !48, i64 4} // CHECK:STDOUT: !50 = !{!49, !48, i64 0} // CHECK:STDOUT: !51 = !{!49, !48, i64 4} -// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !55 = !{!"__libc_errno", !48, i64 0} -// CHECK:STDOUT: !56 = !{!55, !48, i64 0} +// CHECK:STDOUT: !52 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !48, i64 0} +// CHECK:STDOUT: !57 = !{!56, !48, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'implicit_default.carbon' @@ -297,13 +298,13 @@ fn Four() { // CHECK:STDOUT: $_ZN1CC2Ev = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !61 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !62 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [8 x i8], align 4, !dbg !62 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !62 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %_.var), !dbg !62 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %_.var), !dbg !62 -// CHECK:STDOUT: ret void, !dbg !64 +// CHECK:STDOUT: %_.var = alloca [8 x i8], align 4, !dbg !63 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !63 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %_.var), !dbg !63 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %_.var), !dbg !63 +// CHECK:STDOUT: ret void, !dbg !65 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -317,24 +318,24 @@ fn Four() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret([8 x i8]) %return) #2 !dbg !66 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret([8 x i8]) %return) #2 !dbg !67 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !67 -// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !68 +// CHECK:STDOUT: ret void, !dbg !68 // 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 !68 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !71 -// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret([8 x i8]) %return) #0 !dbg !69 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !72 +// CHECK:STDOUT: ret void, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %t) #0 !dbg !73 { -// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %t) #0 !dbg !74 { +// CHECK:STDOUT: ret void, !dbg !79 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable @@ -356,9 +357,9 @@ fn Four() { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!58} -// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!56} +// CHECK:STDOUT: !llvm.dbg.cu = !{!59} +// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !55, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -378,28 +379,29 @@ fn Four() { // CHECK:STDOUT: !49 = !{!"_ZTS1C", !48, i64 0, !48, i64 4} // CHECK:STDOUT: !50 = !{!49, !48, i64 0} // CHECK:STDOUT: !51 = !{!49, !48, i64 4} -// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !55 = !{!"__libc_errno", !48, i64 0} -// CHECK:STDOUT: !56 = !{!55, !48, i64 0} -// CHECK:STDOUT: !57 = !DIFile(filename: "implicit_default.carbon", directory: "") -// CHECK:STDOUT: !58 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !57, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !59 = !{!23} -// CHECK:STDOUT: !60 = !DISubroutineType(types: !59) -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !57, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !58) -// CHECK:STDOUT: !62 = !DILocation(line: 7, column: 3, scope: !61) -// CHECK:STDOUT: !64 = !DILocation(line: 6, column: 1, scope: !61) -// CHECK:STDOUT: !65 = !DIFile(filename: "./default.h", directory: "") -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !65, line: 4, type: !60, spFlags: DISPFlagDefinition, unit: !58) -// CHECK:STDOUT: !67 = !DILocation(line: 4, column: 3, scope: !66) -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !4, line: 9, type: !60, spFlags: DISPFlagDefinition, unit: !58) -// CHECK:STDOUT: !71 = !DILocation(line: 9, column: 28, scope: !68) -// CHECK:STDOUT: !72 = !DILocation(line: 9, column: 21, scope: !68) -// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.4d2f117a5a2332f0", scope: null, file: !10, line: 32, type: !25, spFlags: DISPFlagDefinition, unit: !58, retainedNodes: !79) -// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !23) -// CHECK:STDOUT: !78 = !DILocation(line: 32, column: 1, scope: !73) -// CHECK:STDOUT: !79 = !{!74} +// CHECK:STDOUT: !52 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !48, i64 0} +// CHECK:STDOUT: !57 = !{!56, !48, i64 0} +// CHECK:STDOUT: !58 = !DIFile(filename: "implicit_default.carbon", directory: "") +// CHECK:STDOUT: !59 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !58, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !60 = !{!23} +// CHECK:STDOUT: !61 = !DISubroutineType(types: !60) +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !58, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !59) +// CHECK:STDOUT: !63 = !DILocation(line: 7, column: 3, scope: !62) +// CHECK:STDOUT: !65 = !DILocation(line: 6, column: 1, scope: !62) +// CHECK:STDOUT: !66 = !DIFile(filename: "./default.h", directory: "") +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !66, line: 4, type: !61, spFlags: DISPFlagDefinition, unit: !59) +// CHECK:STDOUT: !68 = !DILocation(line: 4, column: 3, scope: !67) +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !4, line: 9, type: !61, spFlags: DISPFlagDefinition, unit: !59) +// CHECK:STDOUT: !72 = !DILocation(line: 9, column: 28, scope: !69) +// CHECK:STDOUT: !73 = !DILocation(line: 9, column: 21, scope: !69) +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.4d2f117a5a2332f0", scope: null, file: !10, line: 32, type: !25, spFlags: DISPFlagDefinition, unit: !59, retainedNodes: !80) +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !23) +// CHECK:STDOUT: !79 = !DILocation(line: 32, column: 1, scope: !74) +// CHECK:STDOUT: !80 = !{!75} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'defaulted_default.carbon' @@ -415,94 +417,94 @@ fn Four() { // CHECK:STDOUT: $_ZN26ExplicitlyDefaultedDefaultC2Ev = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !82 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !83 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc8_65.1.temp = alloca [4 x i8], align 4, !dbg !83 -// CHECK:STDOUT: %_.var.loc9 = alloca [4 x i8], align 4, !dbg !86 -// CHECK:STDOUT: %.loc12_65.1.temp = alloca [4 x i8], align 4, !dbg !88 -// CHECK:STDOUT: %_.var.loc13 = alloca [4 x i8], align 4, !dbg !91 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_65.1.temp), !dbg !83 -// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc8_65.1.temp), !dbg !83 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc9), !dbg !86 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9"(ptr %_.var.loc9), !dbg !86 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_65.1.temp), !dbg !88 -// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc12_65.1.temp), !dbg !88 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc13), !dbg !91 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271"(ptr %_.var.loc13), !dbg !91 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.d07982f4dd457e72(ptr %_.var.loc13), !dbg !91 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.d07982f4dd457e72(ptr %.loc12_65.1.temp), !dbg !88 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.3d110fbad655625b(ptr %_.var.loc9), !dbg !86 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.3d110fbad655625b(ptr %.loc8_65.1.temp), !dbg !83 -// CHECK:STDOUT: ret void, !dbg !93 +// CHECK:STDOUT: %.loc8_65.1.temp = alloca [4 x i8], align 4, !dbg !84 +// CHECK:STDOUT: %_.var.loc9 = alloca [4 x i8], align 4, !dbg !87 +// CHECK:STDOUT: %.loc12_65.1.temp = alloca [4 x i8], align 4, !dbg !89 +// CHECK:STDOUT: %_.var.loc13 = alloca [4 x i8], align 4, !dbg !92 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_65.1.temp), !dbg !84 +// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc8_65.1.temp), !dbg !84 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc9), !dbg !87 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9"(ptr %_.var.loc9), !dbg !87 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_65.1.temp), !dbg !89 +// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %.loc12_65.1.temp), !dbg !89 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.loc13), !dbg !92 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271"(ptr %_.var.loc13), !dbg !92 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.d07982f4dd457e72(ptr %_.var.loc13), !dbg !92 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.d07982f4dd457e72(ptr %.loc12_65.1.temp), !dbg !89 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.3d110fbad655625b(ptr %_.var.loc9), !dbg !87 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.3d110fbad655625b(ptr %.loc8_65.1.temp), !dbg !84 +// CHECK:STDOUT: ret void, !dbg !94 // 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 !124 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !124 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !125 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !125 // 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 weak_odr void @"_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !95 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !96 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !96 -// CHECK:STDOUT: ret void, !dbg !96 +// CHECK:STDOUT: call void @_ZN26ImplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !97 +// CHECK:STDOUT: ret void, !dbg !97 // 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 !128 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !128 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !129 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !129 // 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 weak_odr void @"_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !97 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp"(ptr sret([4 x i8]) %return) #2 !dbg !98 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !98 -// CHECK:STDOUT: ret void, !dbg !98 +// CHECK:STDOUT: call void @_ZN26ExplicitlyDefaultedDefaultC1Ev.carbon_thunk.(ptr %return), !dbg !99 +// CHECK:STDOUT: ret void, !dbg !99 // 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 !99 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr %return), !dbg !102 -// CHECK:STDOUT: ret void, !dbg !103 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9"(ptr sret([4 x i8]) %return) #0 !dbg !100 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp"(ptr %return), !dbg !103 +// CHECK:STDOUT: ret void, !dbg !104 // 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 !104 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp"(ptr %return), !dbg !107 -// CHECK:STDOUT: ret void, !dbg !108 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271"(ptr sret([4 x i8]) %return) #0 !dbg !105 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp"(ptr %return), !dbg !108 +// CHECK:STDOUT: ret void, !dbg !109 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.d07982f4dd457e72(ptr %t) #0 !dbg !109 { -// CHECK:STDOUT: ret void, !dbg !114 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.d07982f4dd457e72(ptr %t) #0 !dbg !110 { +// CHECK:STDOUT: ret void, !dbg !115 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.3d110fbad655625b(ptr %t) #0 !dbg !116 { -// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.3d110fbad655625b(ptr %t) #0 !dbg !117 { +// CHECK:STDOUT: ret void, !dbg !122 // 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 !124 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !125 // 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 !126 +// CHECK:STDOUT: store i32 1, ptr %x_, align 4, !tbaa !127 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -510,10 +512,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 !128 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !129 // 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 !130 +// CHECK:STDOUT: store i32 1, ptr %x_, align 4, !tbaa !131 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -529,9 +531,9 @@ fn Four() { // CHECK:STDOUT: attributes #4 = { inlinehint 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" } // CHECK:STDOUT: attributes #5 = { 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!81} -// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!56} +// CHECK:STDOUT: !llvm.dbg.cu = !{!82} +// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !55, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -546,48 +548,49 @@ fn Four() { // CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} // CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0} // CHECK:STDOUT: !48 = !{!"int", !44, i64 0} -// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !55 = !{!"__libc_errno", !48, i64 0} -// CHECK:STDOUT: !56 = !{!55, !48, i64 0} -// CHECK:STDOUT: !59 = !{!23} -// CHECK:STDOUT: !60 = !DISubroutineType(types: !59) -// CHECK:STDOUT: !80 = !DIFile(filename: "defaulted_default.carbon", directory: "") -// CHECK:STDOUT: !81 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !80, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !80, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !81) -// CHECK:STDOUT: !83 = !DILocation(line: 8, column: 7, scope: !82) -// CHECK:STDOUT: !86 = !DILocation(line: 9, column: 3, scope: !82) -// CHECK:STDOUT: !88 = !DILocation(line: 12, column: 7, scope: !82) -// CHECK:STDOUT: !91 = !DILocation(line: 13, column: 3, scope: !82) -// CHECK:STDOUT: !93 = !DILocation(line: 6, column: 1, scope: !82) -// CHECK:STDOUT: !94 = !DIFile(filename: "./defaulted_default.h", directory: "") -// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp", scope: null, file: !94, line: 2, type: !60, spFlags: DISPFlagDefinition, unit: !81) -// CHECK:STDOUT: !96 = !DILocation(line: 2, column: 8, scope: !95) -// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp", scope: null, file: !94, line: 7, type: !60, spFlags: DISPFlagDefinition, unit: !81) -// CHECK:STDOUT: !98 = !DILocation(line: 7, column: 3, scope: !97) -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9", scope: null, file: !4, line: 9, type: !60, spFlags: DISPFlagDefinition, unit: !81) -// CHECK:STDOUT: !102 = !DILocation(line: 9, column: 28, scope: !99) -// CHECK:STDOUT: !103 = !DILocation(line: 9, column: 21, scope: !99) -// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271", scope: null, file: !4, line: 9, type: !60, spFlags: DISPFlagDefinition, unit: !81) -// CHECK:STDOUT: !107 = !DILocation(line: 9, column: 28, scope: !104) -// CHECK:STDOUT: !108 = !DILocation(line: 9, column: 21, scope: !104) -// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.d07982f4dd457e72", scope: null, file: !10, line: 32, type: !25, spFlags: DISPFlagDefinition, unit: !81, retainedNodes: !115) -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !23) -// CHECK:STDOUT: !114 = !DILocation(line: 32, column: 1, scope: !109) -// CHECK:STDOUT: !115 = !{!110} -// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.3d110fbad655625b", scope: null, file: !10, line: 32, type: !25, spFlags: DISPFlagDefinition, unit: !81, retainedNodes: !122) -// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !23) -// CHECK:STDOUT: !121 = !DILocation(line: 32, column: 1, scope: !116) -// CHECK:STDOUT: !122 = !{!117} -// CHECK:STDOUT: !123 = !{!"p1 _ZTS26ImplicitlyDefaultedDefault", !45, i64 0} -// CHECK:STDOUT: !124 = !{!123, !123, i64 0} -// CHECK:STDOUT: !125 = !{!"_ZTS26ImplicitlyDefaultedDefault", !48, i64 0} -// CHECK:STDOUT: !126 = !{!125, !48, i64 0} -// CHECK:STDOUT: !127 = !{!"p1 _ZTS26ExplicitlyDefaultedDefault", !45, i64 0} -// CHECK:STDOUT: !128 = !{!127, !127, i64 0} -// CHECK:STDOUT: !129 = !{!"_ZTS26ExplicitlyDefaultedDefault", !48, i64 0} -// CHECK:STDOUT: !130 = !{!129, !48, i64 0} +// CHECK:STDOUT: !52 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !48, i64 0} +// CHECK:STDOUT: !57 = !{!56, !48, i64 0} +// CHECK:STDOUT: !60 = !{!23} +// CHECK:STDOUT: !61 = !DISubroutineType(types: !60) +// CHECK:STDOUT: !81 = !DIFile(filename: "defaulted_default.carbon", directory: "") +// CHECK:STDOUT: !82 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !81, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !81, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !82) +// CHECK:STDOUT: !84 = !DILocation(line: 8, column: 7, scope: !83) +// CHECK:STDOUT: !87 = !DILocation(line: 9, column: 3, scope: !83) +// CHECK:STDOUT: !89 = !DILocation(line: 12, column: 7, scope: !83) +// CHECK:STDOUT: !92 = !DILocation(line: 13, column: 3, scope: !83) +// CHECK:STDOUT: !94 = !DILocation(line: 6, column: 1, scope: !83) +// CHECK:STDOUT: !95 = !DIFile(filename: "./defaulted_default.h", directory: "") +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.48fb4c4d31b7d0bf.Core:ImplicitlyDefaultedDefault.Cpp", scope: null, file: !95, line: 2, type: !61, spFlags: DISPFlagDefinition, unit: !82) +// CHECK:STDOUT: !97 = !DILocation(line: 2, column: 8, scope: !96) +// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.f7ca6602362234ee.Core:ExplicitlyDefaultedDefault.Cpp", scope: null, file: !95, line: 7, type: !61, spFlags: DISPFlagDefinition, unit: !82) +// CHECK:STDOUT: !99 = !DILocation(line: 7, column: 3, scope: !98) +// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.c20bae04b665a8c9", scope: null, file: !4, line: 9, type: !61, spFlags: DISPFlagDefinition, unit: !82) +// CHECK:STDOUT: !103 = !DILocation(line: 9, column: 28, scope: !100) +// CHECK:STDOUT: !104 = !DILocation(line: 9, column: 21, scope: !100) +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.055ae7235dade271", scope: null, file: !4, line: 9, type: !61, spFlags: DISPFlagDefinition, unit: !82) +// CHECK:STDOUT: !108 = !DILocation(line: 9, column: 28, scope: !105) +// CHECK:STDOUT: !109 = !DILocation(line: 9, column: 21, scope: !105) +// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.d07982f4dd457e72", scope: null, file: !10, line: 32, type: !25, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !116) +// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !23) +// CHECK:STDOUT: !115 = !DILocation(line: 32, column: 1, scope: !110) +// CHECK:STDOUT: !116 = !{!111} +// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.3d110fbad655625b", scope: null, file: !10, line: 32, type: !25, spFlags: DISPFlagDefinition, unit: !82, retainedNodes: !123) +// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !117, type: !23) +// CHECK:STDOUT: !122 = !DILocation(line: 32, column: 1, scope: !117) +// CHECK:STDOUT: !123 = !{!118} +// CHECK:STDOUT: !124 = !{!"p1 _ZTS26ImplicitlyDefaultedDefault", !45, i64 0} +// CHECK:STDOUT: !125 = !{!124, !124, i64 0} +// CHECK:STDOUT: !126 = !{!"_ZTS26ImplicitlyDefaultedDefault", !48, i64 0} +// CHECK:STDOUT: !127 = !{!126, !48, i64 0} +// CHECK:STDOUT: !128 = !{!"p1 _ZTS26ExplicitlyDefaultedDefault", !45, i64 0} +// CHECK:STDOUT: !129 = !{!128, !128, i64 0} +// CHECK:STDOUT: !130 = !{!"_ZTS26ExplicitlyDefaultedDefault", !48, i64 0} +// CHECK:STDOUT: !131 = !{!130, !48, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_copy.carbon' @@ -596,12 +599,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 !137 { +// CHECK:STDOUT: define void @_CCopy.Main(ptr sret([4 x i8]) %return, ptr %c) #0 !dbg !138 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_10.1.temp = alloca [4 x i8], align 4, !dbg !142 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_10.1.temp), !dbg !142 -// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %c, ptr %return), !dbg !142 -// CHECK:STDOUT: ret void, !dbg !143 +// CHECK:STDOUT: %.loc7_10.1.temp = alloca [4 x i8], align 4, !dbg !143 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_10.1.temp), !dbg !143 +// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %c, ptr %return), !dbg !143 +// CHECK:STDOUT: ret void, !dbg !144 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -609,19 +612,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 !151 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !151 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !151 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !151 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !152 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !152 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !152 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !152 // 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 weak_odr void @"_COp:thunk:Copy.58fe21e3ef78b0d7.Core:Copy.Cpp"(ptr sret([4 x i8]) %return, ptr %self) #2 !dbg !146 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.58fe21e3ef78b0d7.Core:Copy.Cpp"(ptr sret([4 x i8]) %return, ptr %self) #2 !dbg !147 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !148 -// CHECK:STDOUT: ret void, !dbg !148 +// CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !149 +// CHECK:STDOUT: ret void, !dbg !149 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -635,9 +638,9 @@ fn Four() { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!132} -// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!56} +// CHECK:STDOUT: !llvm.dbg.cu = !{!133} +// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !55, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -646,27 +649,28 @@ fn Four() { // CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} // CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0} // CHECK:STDOUT: !48 = !{!"int", !44, i64 0} -// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !55 = !{!"__libc_errno", !48, i64 0} -// CHECK:STDOUT: !56 = !{!55, !48, i64 0} -// CHECK:STDOUT: !131 = !DIFile(filename: "call_copy.carbon", directory: "") -// CHECK:STDOUT: !132 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !131, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !133 = !{!23, !23} -// CHECK:STDOUT: !134 = !DISubroutineType(types: !133) -// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "Copy", linkageName: "_CCopy.Main", scope: null, file: !131, line: 6, type: !134, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !144) -// CHECK:STDOUT: !138 = !DILocalVariable(arg: 1, scope: !137, type: !23) -// CHECK:STDOUT: !142 = !DILocation(line: 7, column: 10, scope: !137) -// CHECK:STDOUT: !143 = !DILocation(line: 7, column: 3, scope: !137) -// CHECK:STDOUT: !144 = !{!138} -// CHECK:STDOUT: !145 = !DIFile(filename: "./copy.h", directory: "") -// CHECK:STDOUT: !146 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.58fe21e3ef78b0d7.Core:Copy.Cpp", scope: null, file: !145, line: 5, type: !134, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !149) -// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !146, type: !23) -// CHECK:STDOUT: !148 = !DILocation(line: 5, column: 3, scope: !146) -// CHECK:STDOUT: !149 = !{!147} -// CHECK:STDOUT: !150 = !{!"p1 _ZTS4Copy", !45, i64 0} -// CHECK:STDOUT: !151 = !{!150, !150, i64 0} +// CHECK:STDOUT: !52 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !48, i64 0} +// CHECK:STDOUT: !57 = !{!56, !48, i64 0} +// CHECK:STDOUT: !132 = !DIFile(filename: "call_copy.carbon", directory: "") +// CHECK:STDOUT: !133 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !132, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !134 = !{!23, !23} +// CHECK:STDOUT: !135 = !DISubroutineType(types: !134) +// CHECK:STDOUT: !138 = distinct !DISubprogram(name: "Copy", linkageName: "_CCopy.Main", scope: null, file: !132, line: 6, type: !135, spFlags: DISPFlagDefinition, unit: !133, retainedNodes: !145) +// CHECK:STDOUT: !139 = !DILocalVariable(arg: 1, scope: !138, type: !23) +// CHECK:STDOUT: !143 = !DILocation(line: 7, column: 10, scope: !138) +// CHECK:STDOUT: !144 = !DILocation(line: 7, column: 3, scope: !138) +// CHECK:STDOUT: !145 = !{!139} +// CHECK:STDOUT: !146 = !DIFile(filename: "./copy.h", directory: "") +// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.58fe21e3ef78b0d7.Core:Copy.Cpp", scope: null, file: !146, line: 5, type: !135, spFlags: DISPFlagDefinition, unit: !133, retainedNodes: !150) +// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !23) +// CHECK:STDOUT: !149 = !DILocation(line: 5, column: 3, scope: !147) +// CHECK:STDOUT: !150 = !{!148} +// CHECK:STDOUT: !151 = !{!"p1 _ZTS4Copy", !45, i64 0} +// CHECK:STDOUT: !152 = !{!151, !151, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_c1_in_thunk.carbon' @@ -698,21 +702,21 @@ 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 !155 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !156 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_44.1.temp = alloca [8 x i8], align 8, !dbg !156 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_44.1.temp), !dbg !156 -// CHECK:STDOUT: call void @_ZN7DerivedC1Ev.carbon_thunk.(ptr %.loc7_44.1.temp), !dbg !156 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.8073a50a45cfdc9c(ptr %.loc7_44.1.temp), !dbg !156 -// CHECK:STDOUT: ret void, !dbg !159 +// CHECK:STDOUT: %.loc7_44.1.temp = alloca [8 x i8], align 8, !dbg !157 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_44.1.temp), !dbg !157 +// CHECK:STDOUT: call void @_ZN7DerivedC1Ev.carbon_thunk.(ptr %.loc7_44.1.temp), !dbg !157 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.8073a50a45cfdc9c(ptr %.loc7_44.1.temp), !dbg !157 +// CHECK:STDOUT: ret void, !dbg !160 // 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 !168 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !168 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !169 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !169 // CHECK:STDOUT: call void @_ZN7DerivedC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #0 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -721,17 +725,17 @@ fn Four() { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.8073a50a45cfdc9c(ptr %t) #0 !dbg !160 { -// CHECK:STDOUT: ret void, !dbg !165 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.8073a50a45cfdc9c(ptr %t) #0 !dbg !161 { +// CHECK:STDOUT: ret void, !dbg !166 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable // 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 !168 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !169 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 -// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) (i8, ptr @_ZTV7Derived, i64 24), ptr %this1, align 8, !tbaa !170 +// CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) (i8, ptr @_ZTV7Derived, i64 24), ptr %this1, align 8, !tbaa !171 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -740,9 +744,9 @@ fn Four() { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { inlinehint 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!154} -// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!56} +// CHECK:STDOUT: !llvm.dbg.cu = !{!155} +// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !55, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -756,24 +760,25 @@ fn Four() { // CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} // CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0} // CHECK:STDOUT: !48 = !{!"int", !44, i64 0} -// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !55 = !{!"__libc_errno", !48, i64 0} -// CHECK:STDOUT: !56 = !{!55, !48, i64 0} -// CHECK:STDOUT: !153 = !DIFile(filename: "call_c1_in_thunk.carbon", directory: "") -// CHECK:STDOUT: !154 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !153, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !155 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !153, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !154) -// CHECK:STDOUT: !156 = !DILocation(line: 7, column: 24, scope: !155) -// CHECK:STDOUT: !159 = !DILocation(line: 6, column: 1, scope: !155) -// CHECK:STDOUT: !160 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.8073a50a45cfdc9c", scope: null, file: !10, line: 32, type: !25, spFlags: DISPFlagDefinition, unit: !154, retainedNodes: !166) -// CHECK:STDOUT: !161 = !DILocalVariable(arg: 1, scope: !160, type: !23) -// CHECK:STDOUT: !165 = !DILocation(line: 32, column: 1, scope: !160) -// CHECK:STDOUT: !166 = !{!161} -// CHECK:STDOUT: !167 = !{!"p1 _ZTS7Derived", !45, i64 0} -// CHECK:STDOUT: !168 = !{!167, !167, i64 0} -// CHECK:STDOUT: !169 = !{!"vtable pointer", !43, i64 0} -// CHECK:STDOUT: !170 = !{!169, !169, i64 0} +// CHECK:STDOUT: !52 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !48, i64 0} +// CHECK:STDOUT: !57 = !{!56, !48, i64 0} +// CHECK:STDOUT: !154 = !DIFile(filename: "call_c1_in_thunk.carbon", directory: "") +// CHECK:STDOUT: !155 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !154, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !154, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !155) +// CHECK:STDOUT: !157 = !DILocation(line: 7, column: 24, scope: !156) +// CHECK:STDOUT: !160 = !DILocation(line: 6, column: 1, scope: !156) +// CHECK:STDOUT: !161 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.8073a50a45cfdc9c", scope: null, file: !10, line: 32, type: !25, spFlags: DISPFlagDefinition, unit: !155, retainedNodes: !167) +// CHECK:STDOUT: !162 = !DILocalVariable(arg: 1, scope: !161, type: !23) +// CHECK:STDOUT: !166 = !DILocation(line: 32, column: 1, scope: !161) +// CHECK:STDOUT: !167 = !{!162} +// CHECK:STDOUT: !168 = !{!"p1 _ZTS7Derived", !45, i64 0} +// CHECK:STDOUT: !169 = !{!168, !168, i64 0} +// CHECK:STDOUT: !170 = !{!"vtable pointer", !43, i64 0} +// CHECK:STDOUT: !171 = !{!170, !170, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_multi_argument.carbon' @@ -790,25 +795,25 @@ fn Four() { // CHECK:STDOUT: $_ZN9MultiArgCC2Eiiii = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CZero.Main() #0 !dbg !181 { +// CHECK:STDOUT: define void @_CZero.Main() #0 !dbg !182 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_50.1.temp = alloca [1 x i8], align 1, !dbg !182 -// CHECK:STDOUT: %.loc8_27.2.temp = alloca [1 x i8], align 1, !dbg !185 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_50.1.temp), !dbg !182 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ev.carbon_thunk.(ptr %.loc7_50.1.temp), !dbg !182 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_27.2.temp), !dbg !185 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ev.carbon_thunk_tuple.(ptr %.loc8_27.2.temp), !dbg !185 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc8_27.2.temp), !dbg !185 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc7_50.1.temp), !dbg !182 -// CHECK:STDOUT: ret void, !dbg !188 +// CHECK:STDOUT: %.loc7_50.1.temp = alloca [1 x i8], align 1, !dbg !183 +// CHECK:STDOUT: %.loc8_27.2.temp = alloca [1 x i8], align 1, !dbg !186 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_50.1.temp), !dbg !183 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ev.carbon_thunk.(ptr %.loc7_50.1.temp), !dbg !183 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_27.2.temp), !dbg !186 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ev.carbon_thunk_tuple.(ptr %.loc8_27.2.temp), !dbg !186 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc8_27.2.temp), !dbg !186 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc7_50.1.temp), !dbg !183 +// CHECK:STDOUT: ret void, !dbg !189 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Ev.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 !232 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !232 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !233 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -817,28 +822,28 @@ fn Four() { // CHECK:STDOUT: define internal void @_ZN9MultiArgCC1Ev.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 !232 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !232 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !233 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Ev(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 !189 { +// CHECK:STDOUT: define void @_COne.Main() #0 !dbg !190 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc12_51.1.temp = alloca [1 x i8], align 1, !dbg !190 -// CHECK:STDOUT: %.loc13_26.1.temp = alloca [1 x i8], align 1, !dbg !193 -// CHECK:STDOUT: %.loc14_29.2.temp = alloca [1 x i8], align 1, !dbg !196 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_51.1.temp), !dbg !190 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk._(i32 1, ptr %.loc12_51.1.temp), !dbg !190 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_26.1.temp), !dbg !193 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk._(i32 2, ptr %.loc13_26.1.temp), !dbg !193 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_29.2.temp), !dbg !196 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk_tuple._(i32 3, ptr %.loc14_29.2.temp), !dbg !196 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc14_29.2.temp), !dbg !196 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc13_26.1.temp), !dbg !193 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc12_51.1.temp), !dbg !190 -// CHECK:STDOUT: ret void, !dbg !199 +// CHECK:STDOUT: %.loc12_51.1.temp = alloca [1 x i8], align 1, !dbg !191 +// CHECK:STDOUT: %.loc13_26.1.temp = alloca [1 x i8], align 1, !dbg !194 +// CHECK:STDOUT: %.loc14_29.2.temp = alloca [1 x i8], align 1, !dbg !197 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_51.1.temp), !dbg !191 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk._(i32 1, ptr %.loc12_51.1.temp), !dbg !191 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_26.1.temp), !dbg !194 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk._(i32 2, ptr %.loc13_26.1.temp), !dbg !194 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_29.2.temp), !dbg !197 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Ei.carbon_thunk_tuple._(i32 3, ptr %.loc14_29.2.temp), !dbg !197 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc14_29.2.temp), !dbg !197 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc13_26.1.temp), !dbg !194 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc12_51.1.temp), !dbg !191 +// CHECK:STDOUT: ret void, !dbg !200 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -846,10 +851,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 !233 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !233 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !234 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Ei(ptr noundef nonnull align 1 dereferenceable(1) %1, i32 noundef %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -859,26 +864,26 @@ 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 !233 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !233 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %2 = load i32, ptr %.addr, align 4, !tbaa !234 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Ei(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 !200 { +// CHECK:STDOUT: define void @_CTwo.Main() #0 !dbg !201 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_54.1.temp = alloca [1 x i8], align 1, !dbg !201 -// CHECK:STDOUT: %.loc19_31.2.temp = alloca [1 x i8], align 1, !dbg !204 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_54.1.temp), !dbg !201 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eii.carbon_thunk.__(i32 1, i32 2, ptr %.loc18_54.1.temp), !dbg !201 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_31.2.temp), !dbg !204 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eii.carbon_thunk_tuple.__(i32 3, i32 4, ptr %.loc19_31.2.temp), !dbg !204 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc19_31.2.temp), !dbg !204 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc18_54.1.temp), !dbg !201 -// CHECK:STDOUT: ret void, !dbg !207 +// CHECK:STDOUT: %.loc18_54.1.temp = alloca [1 x i8], align 1, !dbg !202 +// CHECK:STDOUT: %.loc19_31.2.temp = alloca [1 x i8], align 1, !dbg !205 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_54.1.temp), !dbg !202 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eii.carbon_thunk.__(i32 1, i32 2, ptr %.loc18_54.1.temp), !dbg !202 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_31.2.temp), !dbg !205 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eii.carbon_thunk_tuple.__(i32 3, i32 4, ptr %.loc19_31.2.temp), !dbg !205 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc19_31.2.temp), !dbg !205 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc18_54.1.temp), !dbg !202 +// CHECK:STDOUT: ret void, !dbg !208 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -887,12 +892,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 !233 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !233 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !233 -// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !233 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !234 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !234 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Eii(ptr noundef nonnull align 1 dereferenceable(1) %2, i32 noundef %3, i32 noundef %4) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -903,28 +908,28 @@ 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 !233 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !233 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !233 -// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !233 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !234 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %3 = load i32, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !234 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Eii(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 !208 { +// CHECK:STDOUT: define void @_CThree.Main() #0 !dbg !209 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc23_57.1.temp = alloca [1 x i8], align 1, !dbg !209 -// CHECK:STDOUT: %.loc24_34.2.temp = alloca [1 x i8], align 1, !dbg !212 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_57.1.temp), !dbg !209 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk.___(i32 1, i32 2, i32 3, ptr %.loc23_57.1.temp), !dbg !209 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_34.2.temp), !dbg !212 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk_tuple.___(i32 4, i32 5, i32 6, ptr %.loc24_34.2.temp), !dbg !212 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc24_34.2.temp), !dbg !212 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc23_57.1.temp), !dbg !209 -// CHECK:STDOUT: ret void, !dbg !215 +// CHECK:STDOUT: %.loc23_57.1.temp = alloca [1 x i8], align 1, !dbg !210 +// CHECK:STDOUT: %.loc24_34.2.temp = alloca [1 x i8], align 1, !dbg !213 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc23_57.1.temp), !dbg !210 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk.___(i32 1, i32 2, i32 3, ptr %.loc23_57.1.temp), !dbg !210 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_34.2.temp), !dbg !213 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk_tuple.___(i32 4, i32 5, i32 6, ptr %.loc24_34.2.temp), !dbg !213 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc24_34.2.temp), !dbg !213 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc23_57.1.temp), !dbg !210 +// CHECK:STDOUT: ret void, !dbg !216 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -934,14 +939,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 !233 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !233 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !233 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %3 = load ptr, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !233 -// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !233 -// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !233 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !234 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %3 = load ptr, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !234 +// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !234 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Eiiii(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: } @@ -953,30 +958,30 @@ 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 !233 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !233 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !233 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %3 = load ptr, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !233 -// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !233 -// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !233 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !234 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %3 = load ptr, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %4 = load i32, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: %5 = load i32, ptr %.addr1, align 4, !tbaa !234 +// CHECK:STDOUT: %6 = load i32, ptr %.addr2, align 4, !tbaa !234 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Eiiii(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 !216 { +// CHECK:STDOUT: define void @_CFour.Main() #0 !dbg !217 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc28_60.1.temp = alloca [1 x i8], align 1, !dbg !217 -// CHECK:STDOUT: %.loc29_37.2.temp = alloca [1 x i8], align 1, !dbg !220 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc28_60.1.temp), !dbg !217 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk.____(i32 1, i32 2, i32 3, i32 4, ptr %.loc28_60.1.temp), !dbg !217 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_37.2.temp), !dbg !220 -// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk_tuple.____(i32 5, i32 6, i32 7, i32 8, ptr %.loc29_37.2.temp), !dbg !220 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc29_37.2.temp), !dbg !220 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc28_60.1.temp), !dbg !217 -// CHECK:STDOUT: ret void, !dbg !223 +// CHECK:STDOUT: %.loc28_60.1.temp = alloca [1 x i8], align 1, !dbg !218 +// CHECK:STDOUT: %.loc29_37.2.temp = alloca [1 x i8], align 1, !dbg !221 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc28_60.1.temp), !dbg !218 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk.____(i32 1, i32 2, i32 3, i32 4, ptr %.loc28_60.1.temp), !dbg !218 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc29_37.2.temp), !dbg !221 +// CHECK:STDOUT: call void @_ZN9MultiArgCC1Eiiii.carbon_thunk_tuple.____(i32 5, i32 6, i32 7, i32 8, ptr %.loc29_37.2.temp), !dbg !221 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc29_37.2.temp), !dbg !221 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %.loc28_60.1.temp), !dbg !218 +// CHECK:STDOUT: ret void, !dbg !224 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -987,16 +992,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 !233 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !233 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !233 -// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !233 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %4 = load ptr, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %5 = load i32, ptr %.addr, align 4, !tbaa !233 -// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !233 -// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !233 -// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !233 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !234 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %4 = load ptr, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %5 = load i32, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !234 +// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !234 +// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !234 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Eiiii(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: } @@ -1009,16 +1014,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 !233 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !233 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !233 -// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !233 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %4 = load ptr, ptr %return.addr, align 8, !tbaa !232 -// CHECK:STDOUT: %5 = load i32, ptr %.addr, align 4, !tbaa !233 -// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !233 -// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !233 -// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !233 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !234 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %4 = load ptr, ptr %return.addr, align 8, !tbaa !233 +// CHECK:STDOUT: %5 = load i32, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: %6 = load i32, ptr %.addr1, align 4, !tbaa !234 +// CHECK:STDOUT: %7 = load i32, ptr %.addr2, align 4, !tbaa !234 +// CHECK:STDOUT: %8 = load i32, ptr %.addr3, align 4, !tbaa !234 // CHECK:STDOUT: call void @_ZN9MultiArgCC2Eiiii(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: } @@ -1027,15 +1032,15 @@ fn Four() { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %t) #0 !dbg !224 { -// CHECK:STDOUT: ret void, !dbg !229 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.b81987abcfec64c8(ptr %t) #0 !dbg !225 { +// CHECK:STDOUT: ret void, !dbg !230 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN9MultiArgCC2Ev(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 !232 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !233 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -1045,8 +1050,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 !232 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !233 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !233 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !234 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -1057,9 +1062,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 !232 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !233 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !233 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !233 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !234 // CHECK:STDOUT: %this2 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -1072,11 +1077,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 !232 -// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !233 -// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !233 -// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !233 -// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !233 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !233 +// CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !234 +// CHECK:STDOUT: store i32 %3, ptr %.addr3, align 4, !tbaa !234 // CHECK:STDOUT: %this4 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -1091,9 +1096,9 @@ fn Four() { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!172} -// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!56} +// CHECK:STDOUT: !llvm.dbg.cu = !{!173} +// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !55, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -1107,39 +1112,40 @@ fn Four() { // CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} // CHECK:STDOUT: !45 = !{!"any pointer", !44, i64 0} // CHECK:STDOUT: !48 = !{!"int", !44, i64 0} -// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !55 = !{!"__libc_errno", !48, i64 0} -// CHECK:STDOUT: !56 = !{!55, !48, i64 0} -// CHECK:STDOUT: !171 = !DIFile(filename: "call_multi_argument.carbon", directory: "") -// CHECK:STDOUT: !172 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !171, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !181 = distinct !DISubprogram(name: "Zero", linkageName: "_CZero.Main", scope: null, file: !171, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !172) -// CHECK:STDOUT: !182 = !DILocation(line: 7, column: 26, scope: !181) -// CHECK:STDOUT: !185 = !DILocation(line: 8, column: 26, scope: !181) -// CHECK:STDOUT: !188 = !DILocation(line: 6, column: 1, scope: !181) -// CHECK:STDOUT: !189 = distinct !DISubprogram(name: "One", linkageName: "_COne.Main", scope: null, file: !171, line: 11, type: !22, spFlags: DISPFlagDefinition, unit: !172) -// CHECK:STDOUT: !190 = !DILocation(line: 12, column: 26, scope: !189) -// CHECK:STDOUT: !193 = !DILocation(line: 13, column: 26, scope: !189) -// CHECK:STDOUT: !196 = !DILocation(line: 14, column: 26, scope: !189) -// CHECK:STDOUT: !199 = !DILocation(line: 11, column: 1, scope: !189) -// CHECK:STDOUT: !200 = distinct !DISubprogram(name: "Two", linkageName: "_CTwo.Main", scope: null, file: !171, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !172) -// CHECK:STDOUT: !201 = !DILocation(line: 18, column: 26, scope: !200) -// CHECK:STDOUT: !204 = !DILocation(line: 19, column: 26, scope: !200) -// CHECK:STDOUT: !207 = !DILocation(line: 17, column: 1, scope: !200) -// CHECK:STDOUT: !208 = distinct !DISubprogram(name: "Three", linkageName: "_CThree.Main", scope: null, file: !171, line: 22, type: !22, spFlags: DISPFlagDefinition, unit: !172) -// CHECK:STDOUT: !209 = !DILocation(line: 23, column: 26, scope: !208) -// CHECK:STDOUT: !212 = !DILocation(line: 24, column: 26, scope: !208) -// CHECK:STDOUT: !215 = !DILocation(line: 22, column: 1, scope: !208) -// CHECK:STDOUT: !216 = distinct !DISubprogram(name: "Four", linkageName: "_CFour.Main", scope: null, file: !171, line: 27, type: !22, spFlags: DISPFlagDefinition, unit: !172) -// CHECK:STDOUT: !217 = !DILocation(line: 28, column: 26, scope: !216) -// CHECK:STDOUT: !220 = !DILocation(line: 29, column: 26, scope: !216) -// CHECK:STDOUT: !223 = !DILocation(line: 27, column: 1, scope: !216) -// CHECK:STDOUT: !224 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.b81987abcfec64c8", scope: null, file: !10, line: 32, type: !25, spFlags: DISPFlagDefinition, unit: !172, retainedNodes: !230) -// CHECK:STDOUT: !225 = !DILocalVariable(arg: 1, scope: !224, type: !23) -// CHECK:STDOUT: !229 = !DILocation(line: 32, column: 1, scope: !224) -// CHECK:STDOUT: !230 = !{!225} -// CHECK:STDOUT: !231 = !{!"p1 _ZTS9MultiArgC", !45, i64 0} -// CHECK:STDOUT: !232 = !{!231, !231, i64 0} -// CHECK:STDOUT: !233 = !{!48, !48, i64 0} +// CHECK:STDOUT: !52 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !48, i64 0} +// CHECK:STDOUT: !57 = !{!56, !48, i64 0} +// CHECK:STDOUT: !172 = !DIFile(filename: "call_multi_argument.carbon", directory: "") +// CHECK:STDOUT: !173 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !172, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !182 = distinct !DISubprogram(name: "Zero", linkageName: "_CZero.Main", scope: null, file: !172, line: 6, type: !22, spFlags: DISPFlagDefinition, unit: !173) +// CHECK:STDOUT: !183 = !DILocation(line: 7, column: 26, scope: !182) +// CHECK:STDOUT: !186 = !DILocation(line: 8, column: 26, scope: !182) +// CHECK:STDOUT: !189 = !DILocation(line: 6, column: 1, scope: !182) +// CHECK:STDOUT: !190 = distinct !DISubprogram(name: "One", linkageName: "_COne.Main", scope: null, file: !172, line: 11, type: !22, spFlags: DISPFlagDefinition, unit: !173) +// CHECK:STDOUT: !191 = !DILocation(line: 12, column: 26, scope: !190) +// CHECK:STDOUT: !194 = !DILocation(line: 13, column: 26, scope: !190) +// CHECK:STDOUT: !197 = !DILocation(line: 14, column: 26, scope: !190) +// CHECK:STDOUT: !200 = !DILocation(line: 11, column: 1, scope: !190) +// CHECK:STDOUT: !201 = distinct !DISubprogram(name: "Two", linkageName: "_CTwo.Main", scope: null, file: !172, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !173) +// CHECK:STDOUT: !202 = !DILocation(line: 18, column: 26, scope: !201) +// CHECK:STDOUT: !205 = !DILocation(line: 19, column: 26, scope: !201) +// CHECK:STDOUT: !208 = !DILocation(line: 17, column: 1, scope: !201) +// CHECK:STDOUT: !209 = distinct !DISubprogram(name: "Three", linkageName: "_CThree.Main", scope: null, file: !172, line: 22, type: !22, spFlags: DISPFlagDefinition, unit: !173) +// CHECK:STDOUT: !210 = !DILocation(line: 23, column: 26, scope: !209) +// CHECK:STDOUT: !213 = !DILocation(line: 24, column: 26, scope: !209) +// CHECK:STDOUT: !216 = !DILocation(line: 22, column: 1, scope: !209) +// CHECK:STDOUT: !217 = distinct !DISubprogram(name: "Four", linkageName: "_CFour.Main", scope: null, file: !172, line: 27, type: !22, spFlags: DISPFlagDefinition, unit: !173) +// CHECK:STDOUT: !218 = !DILocation(line: 28, column: 26, scope: !217) +// CHECK:STDOUT: !221 = !DILocation(line: 29, column: 26, scope: !217) +// CHECK:STDOUT: !224 = !DILocation(line: 27, column: 1, scope: !217) +// CHECK:STDOUT: !225 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.b81987abcfec64c8", scope: null, file: !10, line: 32, type: !25, spFlags: DISPFlagDefinition, unit: !173, retainedNodes: !231) +// CHECK:STDOUT: !226 = !DILocalVariable(arg: 1, scope: !225, type: !23) +// CHECK:STDOUT: !230 = !DILocation(line: 32, column: 1, scope: !225) +// CHECK:STDOUT: !231 = !{!226} +// CHECK:STDOUT: !232 = !{!"p1 _ZTS9MultiArgC", !45, i64 0} +// CHECK:STDOUT: !233 = !{!232, !232, i64 0} +// CHECK:STDOUT: !234 = !{!48, !48, i64 0} // 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 60b4d3921c7d..ecf64aa7ebc1 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/conversion.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/conversion.carbon @@ -142,8 +142,8 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: attributes #4 = { "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!60, !61, !62, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!64} +// CHECK:STDOUT: !llvm.module.flags = !{!60, !61, !62, !63, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!65} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -177,11 +177,12 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: !55 = !{!54, !54, i64 0} // CHECK:STDOUT: !57 = !{} // CHECK:STDOUT: !58 = !{!"int", !50, i64 0} -// CHECK:STDOUT: !60 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !61 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !62 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !63 = !{!"__libc_errno", !58, i64 0} -// CHECK:STDOUT: !64 = !{!63, !58, i64 0} +// CHECK:STDOUT: !60 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !61 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !62 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !63 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !64 = !{!"__libc_errno", !58, i64 0} +// CHECK:STDOUT: !65 = !{!64, !58, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'class_to_enum.carbon' @@ -190,17 +191,17 @@ fn ConvertToValue(b: Cpp.IntB) { // 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 !68 { +// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !69 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %s.var = alloca i16, align 2, !dbg !71 -// CHECK:STDOUT: %i.var = alloca i16, align 2, !dbg !74 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %s.var), !dbg !71 -// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %s.var), !dbg !71 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %i.var), !dbg !74 -// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %i.var), !dbg !74 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b6485bbba53783ee(ptr %i.var), !dbg !74 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.e9921dfc7dd957f8(ptr %s.var), !dbg !71 -// CHECK:STDOUT: ret void, !dbg !79 +// CHECK:STDOUT: %s.var = alloca i16, align 2, !dbg !72 +// CHECK:STDOUT: %i.var = alloca i16, align 2, !dbg !75 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %s.var), !dbg !72 +// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %s.var), !dbg !72 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %i.var), !dbg !75 +// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %i.var), !dbg !75 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b6485bbba53783ee(ptr %i.var), !dbg !75 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.e9921dfc7dd957f8(ptr %s.var), !dbg !72 +// CHECK:STDOUT: ret void, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -208,12 +209,12 @@ fn ConvertToValue(b: Cpp.IntB) { // 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 !107 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !108 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !108 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !107, !nonnull !57 -// CHECK:STDOUT: %call = call noundef signext i16 @_ZNK5EnumBcv1SEv(ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !111 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !108 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !109 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !109 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !108, !nonnull !57 +// CHECK:STDOUT: %call = call noundef i16 @_ZNK5EnumBcv1SEv(ptr noundef nonnull align 1 dereferenceable(1) %1) +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !112 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: @@ -222,47 +223,47 @@ fn ConvertToValue(b: Cpp.IntB) { // 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 !107 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !108 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !108 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !107, !nonnull !57 -// CHECK:STDOUT: %call = call noundef signext i16 @_ZNK5EnumBcv1IEv(ptr noundef nonnull align 1 dereferenceable(1) %1) -// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !113 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !108 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !109 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !109 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !108, !nonnull !57 +// CHECK:STDOUT: %call = call noundef i16 @_ZNK5EnumBcv1IEv(ptr noundef nonnull align 1 dereferenceable(1) %1) +// CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !114 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !81 { +// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !82 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc20_25.1.temp = alloca i16, align 2, !dbg !84 -// CHECK:STDOUT: %.loc21_25.1.temp = alloca i16, align 2, !dbg !87 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !84 -// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !84 -// CHECK:STDOUT: %.loc20_25.5 = load i16, ptr %.loc20_25.1.temp, align 2, !dbg !84 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_25.1.temp), !dbg !87 -// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %.loc21_25.1.temp), !dbg !87 -// CHECK:STDOUT: %.loc21_25.5 = load i16, ptr %.loc21_25.1.temp, align 2, !dbg !87 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b6485bbba53783ee(ptr %.loc21_25.1.temp), !dbg !87 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.e9921dfc7dd957f8(ptr %.loc20_25.1.temp), !dbg !84 -// CHECK:STDOUT: ret void, !dbg !90 +// CHECK:STDOUT: %.loc20_25.1.temp = alloca i16, align 2, !dbg !85 +// CHECK:STDOUT: %.loc21_25.1.temp = alloca i16, align 2, !dbg !88 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_25.1.temp), !dbg !85 +// CHECK:STDOUT: call void @_ZNK5EnumBcv1SEv.carbon_thunk._(ptr %b, ptr %.loc20_25.1.temp), !dbg !85 +// CHECK:STDOUT: %.loc20_25.5 = load i16, ptr %.loc20_25.1.temp, align 2, !dbg !85 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc21_25.1.temp), !dbg !88 +// CHECK:STDOUT: call void @_ZNK5EnumBcv1IEv.carbon_thunk._(ptr %b, ptr %.loc21_25.1.temp), !dbg !88 +// CHECK:STDOUT: %.loc21_25.5 = load i16, ptr %.loc21_25.1.temp, align 2, !dbg !88 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b6485bbba53783ee(ptr %.loc21_25.1.temp), !dbg !88 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.e9921dfc7dd957f8(ptr %.loc20_25.1.temp), !dbg !85 +// CHECK:STDOUT: ret void, !dbg !91 // 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 void @_CSelfDestruct.Core.b6485bbba53783ee(ptr %t) #0 !dbg !92 { -// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.b6485bbba53783ee(ptr %t) #0 !dbg !93 { +// CHECK:STDOUT: ret void, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.e9921dfc7dd957f8(ptr %t) #0 !dbg !99 { -// CHECK:STDOUT: ret void, !dbg !104 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.e9921dfc7dd957f8(ptr %t) #0 !dbg !100 { +// CHECK:STDOUT: ret void, !dbg !105 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: declare noundef signext i16 @_ZNK5EnumBcv1SEv(ptr noundef nonnull align 1 dereferenceable(1)) #3 +// CHECK:STDOUT: declare noundef i16 @_ZNK5EnumBcv1SEv(ptr noundef nonnull align 1 dereferenceable(1)) #3 // CHECK:STDOUT: -// CHECK:STDOUT: declare noundef signext i16 @_ZNK5EnumBcv1IEv(ptr noundef nonnull align 1 dereferenceable(1)) #3 +// CHECK:STDOUT: declare noundef i16 @_ZNK5EnumBcv1IEv(ptr noundef nonnull align 1 dereferenceable(1)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 3, 2, 1, 0 } @@ -274,9 +275,9 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!66} -// CHECK:STDOUT: !llvm.module.flags = !{!60, !61, !62, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!64} +// CHECK:STDOUT: !llvm.dbg.cu = !{!67} +// CHECK:STDOUT: !llvm.module.flags = !{!60, !61, !62, !63, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!65} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -289,43 +290,44 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: !51 = !{!"any pointer", !50, i64 0} // CHECK:STDOUT: !57 = !{} // CHECK:STDOUT: !58 = !{!"int", !50, i64 0} -// CHECK:STDOUT: !60 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !61 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !62 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !63 = !{!"__libc_errno", !58, i64 0} -// CHECK:STDOUT: !64 = !{!63, !58, i64 0} -// CHECK:STDOUT: !65 = !DIFile(filename: "class_to_enum.carbon", directory: "") -// CHECK:STDOUT: !66 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !65, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !67 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !65, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !80) -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !21) -// CHECK:STDOUT: !71 = !DILocation(line: 15, column: 3, scope: !68) -// CHECK:STDOUT: !74 = !DILocation(line: 16, column: 3, scope: !68) -// CHECK:STDOUT: !77 = !{null, !67} -// CHECK:STDOUT: !78 = !DISubroutineType(types: !77) -// CHECK:STDOUT: !79 = !DILocation(line: 14, column: 1, scope: !68) -// CHECK:STDOUT: !80 = !{!69} -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !65, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !91) -// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !21) -// CHECK:STDOUT: !84 = !DILocation(line: 20, column: 25, scope: !81) -// CHECK:STDOUT: !87 = !DILocation(line: 21, column: 25, scope: !81) -// CHECK:STDOUT: !90 = !DILocation(line: 19, column: 1, scope: !81) -// CHECK:STDOUT: !91 = !{!82} -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.b6485bbba53783ee", scope: null, file: !10, line: 32, type: !78, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !98) -// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !92, type: !67) -// CHECK:STDOUT: !97 = !DILocation(line: 32, column: 1, scope: !92) -// CHECK:STDOUT: !98 = !{!93} -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.e9921dfc7dd957f8", scope: null, file: !10, line: 32, type: !78, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !105) -// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !67) -// CHECK:STDOUT: !104 = !DILocation(line: 32, column: 1, scope: !99) -// CHECK:STDOUT: !105 = !{!100} -// CHECK:STDOUT: !106 = !{!"p1 _ZTS5EnumB", !51, i64 0} -// CHECK:STDOUT: !107 = !{!106, !106, i64 0} -// CHECK:STDOUT: !108 = !{!51, !51, i64 0} -// CHECK:STDOUT: !109 = !{!"_ZTS1S", !50, i64 0} -// CHECK:STDOUT: !111 = !{!109, !109, i64 0} -// CHECK:STDOUT: !112 = !{!"_ZTS1I", !50, i64 0} -// CHECK:STDOUT: !113 = !{!112, !112, i64 0} +// CHECK:STDOUT: !60 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !61 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !62 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !63 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !64 = !{!"__libc_errno", !58, i64 0} +// CHECK:STDOUT: !65 = !{!64, !58, i64 0} +// CHECK:STDOUT: !66 = !DIFile(filename: "class_to_enum.carbon", directory: "") +// CHECK:STDOUT: !67 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !66, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !68 = !DIBasicType(name: "int", size: 16, encoding: DW_ATE_signed) +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !66, line: 14, type: !23, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !81) +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !21) +// CHECK:STDOUT: !72 = !DILocation(line: 15, column: 3, scope: !69) +// CHECK:STDOUT: !75 = !DILocation(line: 16, column: 3, scope: !69) +// CHECK:STDOUT: !78 = !{null, !68} +// CHECK:STDOUT: !79 = !DISubroutineType(types: !78) +// CHECK:STDOUT: !80 = !DILocation(line: 14, column: 1, scope: !69) +// CHECK:STDOUT: !81 = !{!70} +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !66, line: 19, type: !23, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !92) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !21) +// CHECK:STDOUT: !85 = !DILocation(line: 20, column: 25, scope: !82) +// CHECK:STDOUT: !88 = !DILocation(line: 21, column: 25, scope: !82) +// CHECK:STDOUT: !91 = !DILocation(line: 19, column: 1, scope: !82) +// CHECK:STDOUT: !92 = !{!83} +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.b6485bbba53783ee", scope: null, file: !10, line: 32, type: !79, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !99) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !68) +// CHECK:STDOUT: !98 = !DILocation(line: 32, column: 1, scope: !93) +// CHECK:STDOUT: !99 = !{!94} +// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.e9921dfc7dd957f8", scope: null, file: !10, line: 32, type: !79, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !106) +// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !100, type: !68) +// CHECK:STDOUT: !105 = !DILocation(line: 32, column: 1, scope: !100) +// CHECK:STDOUT: !106 = !{!101} +// CHECK:STDOUT: !107 = !{!"p1 _ZTS5EnumB", !51, i64 0} +// CHECK:STDOUT: !108 = !{!107, !107, i64 0} +// CHECK:STDOUT: !109 = !{!51, !51, i64 0} +// CHECK:STDOUT: !110 = !{!"_ZTS1S", !50, i64 0} +// CHECK:STDOUT: !112 = !{!110, !110, i64 0} +// CHECK:STDOUT: !113 = !{!"_ZTS1I", !50, i64 0} +// CHECK:STDOUT: !114 = !{!113, !113, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'class_to_int.carbon' @@ -334,39 +336,39 @@ fn ConvertToValue(b: Cpp.IntB) { // 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 !118 { +// CHECK:STDOUT: define void @_CConvertToVar.Main(ptr %b) #0 !dbg !119 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !121 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !121 -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !121 -// CHECK:STDOUT: store i32 %__carbon_thunk.call, ptr %a.var, align 4, !dbg !121 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %a.var), !dbg !121 -// CHECK:STDOUT: ret void, !dbg !126 +// CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !122 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !122 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !122 +// CHECK:STDOUT: store i32 %__carbon_thunk.call, ptr %a.var, align 4, !dbg !122 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %a.var), !dbg !122 +// CHECK:STDOUT: ret void, !dbg !127 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal noundef i32 @_ZNK4IntBcviEv.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 !144 -// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !144, !nonnull !57 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !145 +// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !145, !nonnull !57 // CHECK:STDOUT: %call = call noundef i32 @_ZNK4IntBcviEv(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 void @_CConvertToValue.Main(ptr %b) #0 !dbg !128 { +// CHECK:STDOUT: define void @_CConvertToValue.Main(ptr %b) #0 !dbg !129 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !131 -// CHECK:STDOUT: ret void, !dbg !134 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK4IntBcviEv.carbon_thunk._(ptr %b), !dbg !132 +// CHECK:STDOUT: ret void, !dbg !135 // 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 void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #0 !dbg !136 { -// CHECK:STDOUT: ret void, !dbg !141 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #0 !dbg !137 { +// CHECK:STDOUT: ret void, !dbg !142 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef i32 @_ZNK4IntBcviEv(ptr noundef nonnull align 1 dereferenceable(1)) #3 @@ -376,9 +378,9 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!115} -// CHECK:STDOUT: !llvm.module.flags = !{!60, !61, !62, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!64} +// CHECK:STDOUT: !llvm.dbg.cu = !{!116} +// CHECK:STDOUT: !llvm.module.flags = !{!60, !61, !62, !63, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!65} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -392,29 +394,30 @@ fn ConvertToValue(b: Cpp.IntB) { // CHECK:STDOUT: !51 = !{!"any pointer", !50, i64 0} // CHECK:STDOUT: !57 = !{} // CHECK:STDOUT: !58 = !{!"int", !50, i64 0} -// CHECK:STDOUT: !60 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !61 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !62 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !63 = !{!"__libc_errno", !58, i64 0} -// CHECK:STDOUT: !64 = !{!63, !58, i64 0} -// CHECK:STDOUT: !114 = !DIFile(filename: "class_to_int.carbon", directory: "") -// CHECK:STDOUT: !115 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !114, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !114, line: 11, type: !23, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !127) -// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !21) -// CHECK:STDOUT: !121 = !DILocation(line: 12, column: 3, scope: !118) -// CHECK:STDOUT: !124 = !{null, !20} -// CHECK:STDOUT: !125 = !DISubroutineType(types: !124) -// CHECK:STDOUT: !126 = !DILocation(line: 11, column: 1, scope: !118) -// CHECK:STDOUT: !127 = !{!119} -// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !114, line: 15, type: !23, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !135) -// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !21) -// CHECK:STDOUT: !131 = !DILocation(line: 16, column: 27, scope: !128) -// CHECK:STDOUT: !134 = !DILocation(line: 15, column: 1, scope: !128) -// CHECK:STDOUT: !135 = !{!129} -// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !10, line: 32, type: !125, spFlags: DISPFlagDefinition, unit: !115, retainedNodes: !142) -// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !20) -// CHECK:STDOUT: !141 = !DILocation(line: 32, column: 1, scope: !136) -// CHECK:STDOUT: !142 = !{!137} -// CHECK:STDOUT: !143 = !{!"p1 _ZTS4IntB", !51, i64 0} -// CHECK:STDOUT: !144 = !{!143, !143, i64 0} +// CHECK:STDOUT: !60 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !61 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !62 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !63 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !64 = !{!"__libc_errno", !58, i64 0} +// CHECK:STDOUT: !65 = !{!64, !58, i64 0} +// CHECK:STDOUT: !115 = !DIFile(filename: "class_to_int.carbon", directory: "") +// CHECK:STDOUT: !116 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !115, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "ConvertToVar", linkageName: "_CConvertToVar.Main", scope: null, file: !115, line: 11, type: !23, spFlags: DISPFlagDefinition, unit: !116, retainedNodes: !128) +// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !21) +// CHECK:STDOUT: !122 = !DILocation(line: 12, column: 3, scope: !119) +// CHECK:STDOUT: !125 = !{null, !20} +// CHECK:STDOUT: !126 = !DISubroutineType(types: !125) +// CHECK:STDOUT: !127 = !DILocation(line: 11, column: 1, scope: !119) +// CHECK:STDOUT: !128 = !{!120} +// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "ConvertToValue", linkageName: "_CConvertToValue.Main", scope: null, file: !115, line: 15, type: !23, spFlags: DISPFlagDefinition, unit: !116, retainedNodes: !136) +// CHECK:STDOUT: !130 = !DILocalVariable(arg: 1, scope: !129, type: !21) +// CHECK:STDOUT: !132 = !DILocation(line: 16, column: 27, scope: !129) +// CHECK:STDOUT: !135 = !DILocation(line: 15, column: 1, scope: !129) +// CHECK:STDOUT: !136 = !{!130} +// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !10, line: 32, type: !126, spFlags: DISPFlagDefinition, unit: !116, retainedNodes: !143) +// CHECK:STDOUT: !138 = !DILocalVariable(arg: 1, scope: !137, type: !20) +// CHECK:STDOUT: !142 = !DILocation(line: 32, column: 1, scope: !137) +// CHECK:STDOUT: !143 = !{!138} +// CHECK:STDOUT: !144 = !{!"p1 _ZTS4IntB", !51, i64 0} +// CHECK:STDOUT: !145 = !{!144, !144, i64 0} // 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 8bf3f5232e65..d919fb7258da 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 @@ -209,8 +209,8 @@ fn PassTemporary() { // CHECK:STDOUT: attributes #4 = { "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!13} -// CHECK:STDOUT: !llvm.module.flags = !{!58, !59, !60, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!63} +// CHECK:STDOUT: !llvm.module.flags = !{!58, !59, !60, !61, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!64} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -252,12 +252,13 @@ fn PassTemporary() { // CHECK:STDOUT: !54 = !{!"any pointer", !53, i64 0} // CHECK:STDOUT: !55 = !{!"p1 _ZTS8Copyable", !54, i64 0} // CHECK:STDOUT: !56 = !{!55, !55, i64 0} -// CHECK:STDOUT: !58 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !59 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !60 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !61 = !{!"int", !53, i64 0} -// CHECK:STDOUT: !62 = !{!"__libc_errno", !61, i64 0} -// CHECK:STDOUT: !63 = !{!62, !61, i64 0} +// CHECK:STDOUT: !58 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !59 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !60 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !61 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !62 = !{!"int", !53, i64 0} +// CHECK:STDOUT: !63 = !{!"__libc_errno", !62, i64 0} +// CHECK:STDOUT: !64 = !{!63, !62, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'copy_or_move.carbon' @@ -274,17 +275,17 @@ fn PassTemporary() { // CHECK:STDOUT: define internal void @_Z17make_copy_or_movev.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 !101 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !101 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !102 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !102 // CHECK:STDOUT: call void @_Z17make_copy_or_movev(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 !66 { +// CHECK:STDOUT: define void @_CPassGlobal.Main() #1 !dbg !67 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr @_Cc.Main), !dbg !68 -// CHECK:STDOUT: ret void, !dbg !69 +// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr @_Cc.Main), !dbg !69 +// CHECK:STDOUT: ret void, !dbg !70 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -292,8 +293,8 @@ 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 !101 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !101 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !102 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !102 // 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 @_Z17pass_copy_or_move10CopyOrMove(ptr nofreeobj noundef align 1 dereferenceable(1) %agg.tmp) // CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1 @@ -301,14 +302,14 @@ fn PassTemporary() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !70 { +// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !71 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !71 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !71 -// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr %_.var), !dbg !72 -// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk.v(ptr %_.var), !dbg !73 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.220fc4c3137ec09a(ptr %_.var), !dbg !71 -// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !72 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !72 +// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr %_.var), !dbg !73 +// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk.v(ptr %_.var), !dbg !74 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.220fc4c3137ec09a(ptr %_.var), !dbg !72 +// CHECK:STDOUT: ret void, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -316,8 +317,8 @@ 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 !101 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !101 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !102 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !102 // 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 @_Z17pass_copy_or_move10CopyOrMove(ptr nofreeobj noundef align 1 dereferenceable(1) %agg.tmp) // CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1 @@ -328,33 +329,33 @@ 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 !75 { +// CHECK:STDOUT: define void @_CPassValue.Main(ptr %c) #1 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !79 -// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !80 +// CHECK:STDOUT: ret void, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !82 { +// CHECK:STDOUT: define void @_CPassRef.Main(ptr %c) #1 !dbg !83 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !86 -// CHECK:STDOUT: ret void, !dbg !87 +// CHECK:STDOUT: call void @_Z17pass_copy_or_move10CopyOrMove.carbon_thunk._(ptr %c), !dbg !87 +// CHECK:STDOUT: ret void, !dbg !88 // 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 @_CSelfDestruct.Core.220fc4c3137ec09a(ptr %t) #1 !dbg !93 { -// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr %t), !dbg !97 -// CHECK:STDOUT: ret void, !dbg !98 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.220fc4c3137ec09a(ptr %t) #1 !dbg !94 { +// CHECK:STDOUT: call void @_ZN10CopyOrMoveD1Ev(ptr %t), !dbg !98 +// CHECK:STDOUT: ret void, !dbg !99 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !89 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !90 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr @_Cc.Main), !dbg !90 -// CHECK:STDOUT: ret void, !dbg !92 +// CHECK:STDOUT: call void @_Z17make_copy_or_movev.carbon_thunk.(ptr @_Cc.Main), !dbg !91 +// CHECK:STDOUT: ret void, !dbg !93 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z17make_copy_or_movev(ptr dead_on_unwind writable sret(%struct.CopyOrMove) align 1) #4 @@ -375,9 +376,9 @@ fn PassTemporary() { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!65} -// CHECK:STDOUT: !llvm.module.flags = !{!58, !59, !60, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!63} +// CHECK:STDOUT: !llvm.dbg.cu = !{!66} +// CHECK:STDOUT: !llvm.module.flags = !{!58, !59, !60, !61, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!64} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -390,42 +391,43 @@ fn PassTemporary() { // CHECK:STDOUT: !52 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !53 = !{!"omnipotent char", !52, i64 0} // CHECK:STDOUT: !54 = !{!"any pointer", !53, i64 0} -// CHECK:STDOUT: !58 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !59 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !60 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !61 = !{!"int", !53, i64 0} -// CHECK:STDOUT: !62 = !{!"__libc_errno", !61, i64 0} -// CHECK:STDOUT: !63 = !{!62, !61, i64 0} -// CHECK:STDOUT: !64 = !DIFile(filename: "copy_or_move.carbon", directory: "") -// CHECK:STDOUT: !65 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !64, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "PassGlobal", linkageName: "_CPassGlobal.Main", scope: null, file: !64, line: 18, type: !18, spFlags: DISPFlagDefinition, unit: !65) -// CHECK:STDOUT: !68 = !DILocation(line: 19, column: 3, scope: !66) -// CHECK:STDOUT: !69 = !DILocation(line: 18, column: 1, scope: !66) -// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !64, line: 22, type: !18, spFlags: DISPFlagDefinition, unit: !65) -// CHECK:STDOUT: !71 = !DILocation(line: 13, column: 34, scope: !70) -// CHECK:STDOUT: !72 = !DILocation(line: 23, column: 25, scope: !70) -// CHECK:STDOUT: !73 = !DILocation(line: 23, column: 3, scope: !70) -// CHECK:STDOUT: !74 = !DILocation(line: 22, column: 1, scope: !70) -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !64, line: 26, type: !16, spFlags: DISPFlagDefinition, unit: !65, retainedNodes: !81) -// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !14) -// CHECK:STDOUT: !79 = !DILocation(line: 27, column: 3, scope: !75) -// CHECK:STDOUT: !80 = !DILocation(line: 26, column: 1, scope: !75) -// CHECK:STDOUT: !81 = !{!76} -// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !64, line: 30, type: !16, spFlags: DISPFlagDefinition, unit: !65, retainedNodes: !88) -// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !14) -// CHECK:STDOUT: !86 = !DILocation(line: 31, column: 3, scope: !82) -// CHECK:STDOUT: !87 = !DILocation(line: 30, column: 1, scope: !82) -// CHECK:STDOUT: !88 = !{!83} -// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !64, type: !18, spFlags: DISPFlagDefinition, unit: !65) -// CHECK:STDOUT: !90 = !DILocation(line: 16, column: 25, scope: !89) -// CHECK:STDOUT: !92 = !DILocation(line: 0, scope: !89) -// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.220fc4c3137ec09a", scope: null, file: !4, line: 32, type: !16, spFlags: DISPFlagDefinition, unit: !65, retainedNodes: !99) -// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !14) -// CHECK:STDOUT: !97 = !DILocation(line: 34, column: 5, scope: !93) -// CHECK:STDOUT: !98 = !DILocation(line: 32, column: 1, scope: !93) -// CHECK:STDOUT: !99 = !{!94} -// CHECK:STDOUT: !100 = !{!"p1 _ZTS10CopyOrMove", !54, i64 0} -// CHECK:STDOUT: !101 = !{!100, !100, i64 0} +// CHECK:STDOUT: !58 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !59 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !60 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !61 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !62 = !{!"int", !53, i64 0} +// CHECK:STDOUT: !63 = !{!"__libc_errno", !62, i64 0} +// CHECK:STDOUT: !64 = !{!63, !62, i64 0} +// CHECK:STDOUT: !65 = !DIFile(filename: "copy_or_move.carbon", directory: "") +// CHECK:STDOUT: !66 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !65, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "PassGlobal", linkageName: "_CPassGlobal.Main", scope: null, file: !65, line: 18, type: !18, spFlags: DISPFlagDefinition, unit: !66) +// CHECK:STDOUT: !69 = !DILocation(line: 19, column: 3, scope: !67) +// CHECK:STDOUT: !70 = !DILocation(line: 18, column: 1, scope: !67) +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !65, line: 22, type: !18, spFlags: DISPFlagDefinition, unit: !66) +// CHECK:STDOUT: !72 = !DILocation(line: 13, column: 34, scope: !71) +// CHECK:STDOUT: !73 = !DILocation(line: 23, column: 25, scope: !71) +// CHECK:STDOUT: !74 = !DILocation(line: 23, column: 3, scope: !71) +// CHECK:STDOUT: !75 = !DILocation(line: 22, column: 1, scope: !71) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "PassValue", linkageName: "_CPassValue.Main", scope: null, file: !65, line: 26, type: !16, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !82) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 1, scope: !76, type: !14) +// CHECK:STDOUT: !80 = !DILocation(line: 27, column: 3, scope: !76) +// CHECK:STDOUT: !81 = !DILocation(line: 26, column: 1, scope: !76) +// CHECK:STDOUT: !82 = !{!77} +// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "PassRef", linkageName: "_CPassRef.Main", scope: null, file: !65, line: 30, type: !16, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !89) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !14) +// CHECK:STDOUT: !87 = !DILocation(line: 31, column: 3, scope: !83) +// CHECK:STDOUT: !88 = !DILocation(line: 30, column: 1, scope: !83) +// CHECK:STDOUT: !89 = !{!84} +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !65, type: !18, spFlags: DISPFlagDefinition, unit: !66) +// CHECK:STDOUT: !91 = !DILocation(line: 16, column: 25, scope: !90) +// CHECK:STDOUT: !93 = !DILocation(line: 0, scope: !90) +// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.220fc4c3137ec09a", scope: null, file: !4, line: 32, type: !16, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !100) +// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !14) +// CHECK:STDOUT: !98 = !DILocation(line: 34, column: 5, scope: !94) +// CHECK:STDOUT: !99 = !DILocation(line: 32, column: 1, scope: !94) +// CHECK:STDOUT: !100 = !{!95} +// CHECK:STDOUT: !101 = !{!"p1 _ZTS10CopyOrMove", !54, i64 0} +// CHECK:STDOUT: !102 = !{!101, !101, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'move_only.carbon' @@ -442,27 +444,27 @@ fn PassTemporary() { // CHECK:STDOUT: define internal void @_Z14make_move_onlyv.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 !124 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !124 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !125 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !125 // CHECK:STDOUT: call void @_Z14make_move_onlyv(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 !105 { +// CHECK:STDOUT: define void @_CPassGlobalByMove.Main() #1 !dbg !106 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !106 +// CHECK:STDOUT: ret void, !dbg !107 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !107 { +// CHECK:STDOUT: define void @_CPassTemporary.Main() #1 !dbg !108 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !108 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !108 -// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr %_.var), !dbg !109 -// CHECK:STDOUT: call void @_Z14pass_move_only8MoveOnly.carbon_thunk.v(ptr %_.var), !dbg !110 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.a3949840fad44321(ptr %_.var), !dbg !108 -// CHECK:STDOUT: ret void, !dbg !111 +// CHECK:STDOUT: %_.var = alloca [1 x i8], align 1, !dbg !109 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !109 +// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr %_.var), !dbg !110 +// CHECK:STDOUT: call void @_Z14pass_move_only8MoveOnly.carbon_thunk.v(ptr %_.var), !dbg !111 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.a3949840fad44321(ptr %_.var), !dbg !109 +// CHECK:STDOUT: ret void, !dbg !112 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -470,8 +472,8 @@ 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 !124 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !124 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !125 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !125 // 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 @_Z14pass_move_only8MoveOnly(ptr nofreeobj noundef align 1 dereferenceable(1) %agg.tmp) // CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %agg.tmp) #1 @@ -485,16 +487,16 @@ fn PassTemporary() { // 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 @_CSelfDestruct.Core.a3949840fad44321(ptr %t) #1 !dbg !116 { -// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr %t), !dbg !120 -// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.a3949840fad44321(ptr %t) #1 !dbg !117 { +// CHECK:STDOUT: call void @_ZN8MoveOnlyD1Ev(ptr %t), !dbg !121 +// CHECK:STDOUT: ret void, !dbg !122 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !112 { +// CHECK:STDOUT: define internal void @_C__global_init.Main() #1 !dbg !113 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr @_Cc.Main), !dbg !113 -// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: call void @_Z14make_move_onlyv.carbon_thunk.(ptr @_Cc.Main), !dbg !114 +// CHECK:STDOUT: ret void, !dbg !116 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z14make_move_onlyv(ptr dead_on_unwind writable sret(%struct.MoveOnly) align 1) #4 @@ -512,9 +514,9 @@ fn PassTemporary() { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!104} -// CHECK:STDOUT: !llvm.module.flags = !{!58, !59, !60, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!63} +// CHECK:STDOUT: !llvm.dbg.cu = !{!105} +// CHECK:STDOUT: !llvm.module.flags = !{!58, !59, !60, !61, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!64} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -527,29 +529,30 @@ fn PassTemporary() { // CHECK:STDOUT: !52 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !53 = !{!"omnipotent char", !52, i64 0} // CHECK:STDOUT: !54 = !{!"any pointer", !53, i64 0} -// CHECK:STDOUT: !58 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !59 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !60 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !61 = !{!"int", !53, i64 0} -// CHECK:STDOUT: !62 = !{!"__libc_errno", !61, i64 0} -// CHECK:STDOUT: !63 = !{!62, !61, i64 0} -// CHECK:STDOUT: !103 = !DIFile(filename: "move_only.carbon", directory: "") -// CHECK:STDOUT: !104 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !103, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "PassGlobalByMove", linkageName: "_CPassGlobalByMove.Main", scope: null, file: !103, line: 22, type: !18, spFlags: DISPFlagDefinition, unit: !104) -// CHECK:STDOUT: !106 = !DILocation(line: 22, column: 1, scope: !105) -// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !103, line: 27, type: !18, spFlags: DISPFlagDefinition, unit: !104) -// CHECK:STDOUT: !108 = !DILocation(line: 17, column: 29, scope: !107) -// CHECK:STDOUT: !109 = !DILocation(line: 28, column: 22, scope: !107) -// CHECK:STDOUT: !110 = !DILocation(line: 28, column: 3, scope: !107) -// CHECK:STDOUT: !111 = !DILocation(line: 27, column: 1, scope: !107) -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !103, type: !18, spFlags: DISPFlagDefinition, unit: !104) -// CHECK:STDOUT: !113 = !DILocation(line: 20, column: 23, scope: !112) -// CHECK:STDOUT: !115 = !DILocation(line: 0, scope: !112) -// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.a3949840fad44321", scope: null, file: !4, line: 32, type: !16, spFlags: DISPFlagDefinition, unit: !104, retainedNodes: !122) -// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !14) -// CHECK:STDOUT: !120 = !DILocation(line: 34, column: 5, scope: !116) -// CHECK:STDOUT: !121 = !DILocation(line: 32, column: 1, scope: !116) -// CHECK:STDOUT: !122 = !{!117} -// CHECK:STDOUT: !123 = !{!"p1 _ZTS8MoveOnly", !54, i64 0} -// CHECK:STDOUT: !124 = !{!123, !123, i64 0} +// CHECK:STDOUT: !58 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !59 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !60 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !61 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !62 = !{!"int", !53, i64 0} +// CHECK:STDOUT: !63 = !{!"__libc_errno", !62, i64 0} +// CHECK:STDOUT: !64 = !{!63, !62, i64 0} +// CHECK:STDOUT: !104 = !DIFile(filename: "move_only.carbon", directory: "") +// CHECK:STDOUT: !105 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !104, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "PassGlobalByMove", linkageName: "_CPassGlobalByMove.Main", scope: null, file: !104, line: 22, type: !18, spFlags: DISPFlagDefinition, unit: !105) +// CHECK:STDOUT: !107 = !DILocation(line: 22, column: 1, scope: !106) +// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "PassTemporary", linkageName: "_CPassTemporary.Main", scope: null, file: !104, line: 27, type: !18, spFlags: DISPFlagDefinition, unit: !105) +// CHECK:STDOUT: !109 = !DILocation(line: 17, column: 29, scope: !108) +// CHECK:STDOUT: !110 = !DILocation(line: 28, column: 22, scope: !108) +// CHECK:STDOUT: !111 = !DILocation(line: 28, column: 3, scope: !108) +// CHECK:STDOUT: !112 = !DILocation(line: 27, column: 1, scope: !108) +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !104, type: !18, spFlags: DISPFlagDefinition, unit: !105) +// CHECK:STDOUT: !114 = !DILocation(line: 20, column: 23, scope: !113) +// CHECK:STDOUT: !116 = !DILocation(line: 0, scope: !113) +// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.a3949840fad44321", scope: null, file: !4, line: 32, type: !16, spFlags: DISPFlagDefinition, unit: !105, retainedNodes: !123) +// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !117, type: !14) +// CHECK:STDOUT: !121 = !DILocation(line: 34, column: 5, scope: !117) +// CHECK:STDOUT: !122 = !DILocation(line: 32, column: 1, scope: !117) +// CHECK:STDOUT: !123 = !{!118} +// CHECK:STDOUT: !124 = !{!"p1 _ZTS8MoveOnly", !54, i64 0} +// CHECK:STDOUT: !125 = !{!124, !124, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/destructor.carbon b/toolchain/lower/testdata/interop/cpp/class/import/destructor.carbon index 113d46fae6ae..ba7981fbecf2 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/destructor.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/destructor.carbon @@ -233,8 +233,8 @@ fn DestroyAIndirectly() { // CHECK:STDOUT: attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!35} -// CHECK:STDOUT: !llvm.module.flags = !{!126, !127, !128, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!131} +// CHECK:STDOUT: !llvm.module.flags = !{!126, !127, !128, !129, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!132} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -311,10 +311,11 @@ fn DestroyAIndirectly() { // CHECK:STDOUT: !123 = !{!122, !122, i64 0} // CHECK:STDOUT: !124 = !{!"p1 _ZTS10Nontrivial", !119, i64 0} // CHECK:STDOUT: !125 = !{!124, !124, i64 0} -// CHECK:STDOUT: !126 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !127 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !128 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !129 = !{!"int", !118, i64 0} -// CHECK:STDOUT: !130 = !{!"__libc_errno", !129, i64 0} -// CHECK:STDOUT: !131 = !{!130, !129, i64 0} +// CHECK:STDOUT: !126 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !127 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !128 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !129 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !130 = !{!"int", !118, i64 0} +// CHECK:STDOUT: !131 = !{!"__libc_errno", !130, i64 0} +// CHECK:STDOUT: !132 = !{!131, !130, i64 0} // 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 ffe528cec4b5..7c4091f28807 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/dynamic.carbon @@ -241,8 +241,8 @@ fn DoThing() { // CHECK:STDOUT: attributes #8 = { inlinehint 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!40} -// CHECK:STDOUT: !llvm.module.flags = !{!115, !116, !117, !7, !8} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!119} +// CHECK:STDOUT: !llvm.module.flags = !{!115, !116, !117, !118, !7, !8} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!120} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -314,9 +314,10 @@ fn DoThing() { // CHECK:STDOUT: !109 = !{!"p1 _ZTSN6Carbon4Main7DerivedE", !2, i64 0} // CHECK:STDOUT: !110 = !{!109, !109, i64 0} // CHECK:STDOUT: !112 = !{!"int", !1, i64 0} -// CHECK:STDOUT: !115 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !116 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !117 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !118 = !{!"__libc_errno", !112, i64 0} -// CHECK:STDOUT: !119 = !{!118, !112, i64 0} +// CHECK:STDOUT: !115 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !116 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !117 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !118 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !119 = !{!"__libc_errno", !112, i64 0} +// CHECK:STDOUT: !120 = !{!119, !112, 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 02a9b18fc9ad..74746f4f8b5d 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/field.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/field.carbon @@ -133,8 +133,8 @@ fn AccessP(a: Cpp.AnonUnionA) -> i32 { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!47} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !43, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -154,14 +154,15 @@ fn AccessP(a: Cpp.AnonUnionA) -> i32 { // CHECK:STDOUT: !37 = !DILocation(line: 13, column: 10, scope: !32) // CHECK:STDOUT: !38 = !DILocation(line: 13, column: 3, scope: !32) // CHECK:STDOUT: !39 = !{!33} -// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} -// CHECK:STDOUT: !45 = !{!"int", !44, i64 0} -// CHECK:STDOUT: !46 = !{!"__libc_errno", !45, i64 0} -// CHECK:STDOUT: !47 = !{!46, !45, i64 0} +// CHECK:STDOUT: !40 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !44 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !45 = !{!"omnipotent char", !44, i64 0} +// CHECK:STDOUT: !46 = !{!"int", !45, i64 0} +// CHECK:STDOUT: !47 = !{!"__libc_errno", !46, i64 0} +// CHECK:STDOUT: !48 = !{!47, !46, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'assign_struct.carbon' @@ -170,52 +171,53 @@ fn AccessP(a: Cpp.AnonUnionA) -> 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 !52 { +// CHECK:STDOUT: define void @_CAssignN.Main(ptr %p) #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_4.2.n = getelementptr inbounds nuw [32 x i8], ptr %p, i32 0, i32 0, !dbg !55 -// CHECK:STDOUT: store i32 1, ptr %.loc9_4.2.n, align 4, !dbg !55 -// CHECK:STDOUT: ret void, !dbg !56 +// CHECK:STDOUT: %.loc9_4.2.n = getelementptr inbounds nuw [32 x i8], ptr %p, i32 0, i32 0, !dbg !56 +// CHECK:STDOUT: store i32 1, ptr %.loc9_4.2.n, align 4, !dbg !56 +// CHECK:STDOUT: ret void, !dbg !57 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CAssignM.Main(ptr %p) #0 !dbg !58 { +// CHECK:STDOUT: define void @_CAssignM.Main(ptr %p) #0 !dbg !59 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc13_4.2.m = getelementptr inbounds nuw [32 x i8], ptr %p, i32 0, i32 16, !dbg !61 -// CHECK:STDOUT: store i32 1, ptr %.loc13_4.2.m, align 4, !dbg !61 -// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: %.loc13_4.2.m = getelementptr inbounds nuw [32 x i8], ptr %p, i32 0, i32 16, !dbg !62 +// CHECK:STDOUT: store i32 1, ptr %.loc13_4.2.m, align 4, !dbg !62 +// CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!49} -// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!47} +// CHECK:STDOUT: !llvm.dbg.cu = !{!50} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !43, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} -// CHECK:STDOUT: !45 = !{!"int", !44, i64 0} -// CHECK:STDOUT: !46 = !{!"__libc_errno", !45, i64 0} -// CHECK:STDOUT: !47 = !{!46, !45, i64 0} -// CHECK:STDOUT: !48 = !DIFile(filename: "assign_struct.carbon", directory: "") -// CHECK:STDOUT: !49 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !48, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !50 = !{null, !21} -// CHECK:STDOUT: !51 = !DISubroutineType(types: !50) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "AssignN", linkageName: "_CAssignN.Main", scope: null, file: !48, line: 8, type: !51, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !57) -// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !21) -// CHECK:STDOUT: !55 = !DILocation(line: 9, column: 3, scope: !52) -// CHECK:STDOUT: !56 = !DILocation(line: 8, column: 1, scope: !52) -// CHECK:STDOUT: !57 = !{!53} -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "AssignM", linkageName: "_CAssignM.Main", scope: null, file: !48, line: 12, type: !51, spFlags: DISPFlagDefinition, unit: !49, retainedNodes: !63) -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !21) -// CHECK:STDOUT: !61 = !DILocation(line: 13, column: 3, scope: !58) -// CHECK:STDOUT: !62 = !DILocation(line: 12, column: 1, scope: !58) -// CHECK:STDOUT: !63 = !{!59} +// CHECK:STDOUT: !40 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !44 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !45 = !{!"omnipotent char", !44, i64 0} +// CHECK:STDOUT: !46 = !{!"int", !45, i64 0} +// CHECK:STDOUT: !47 = !{!"__libc_errno", !46, i64 0} +// CHECK:STDOUT: !48 = !{!47, !46, i64 0} +// CHECK:STDOUT: !49 = !DIFile(filename: "assign_struct.carbon", directory: "") +// CHECK:STDOUT: !50 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !49, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !51 = !{null, !21} +// CHECK:STDOUT: !52 = !DISubroutineType(types: !51) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "AssignN", linkageName: "_CAssignN.Main", scope: null, file: !49, line: 8, type: !52, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !58) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !21) +// CHECK:STDOUT: !56 = !DILocation(line: 9, column: 3, scope: !53) +// CHECK:STDOUT: !57 = !DILocation(line: 8, column: 1, scope: !53) +// CHECK:STDOUT: !58 = !{!54} +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "AssignM", linkageName: "_CAssignM.Main", scope: null, file: !49, line: 12, type: !52, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !64) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !21) +// CHECK:STDOUT: !62 = !DILocation(line: 13, column: 3, scope: !59) +// CHECK:STDOUT: !63 = !DILocation(line: 12, column: 1, scope: !59) +// CHECK:STDOUT: !64 = !{!60} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'access_union.carbon' @@ -224,26 +226,26 @@ fn AccessP(a: Cpp.AnonUnionA) -> 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 !66 { +// CHECK:STDOUT: define i32 @_CAccessN.Main(ptr %a) #0 !dbg !67 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_11.1.n = getelementptr inbounds nuw [4 x i8], ptr %a, i32 0, i32 0, !dbg !71 -// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.n, align 4, !dbg !71 -// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !72 +// CHECK:STDOUT: %.loc7_11.1.n = getelementptr inbounds nuw [4 x i8], ptr %a, i32 0, i32 0, !dbg !72 +// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.n, align 4, !dbg !72 +// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessM.Main(ptr %a) #0 !dbg !74 { +// CHECK:STDOUT: define i32 @_CAccessM.Main(ptr %a) #0 !dbg !75 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_11.1.m = getelementptr inbounds nuw [4 x i8], ptr %a, i32 0, i32 0, !dbg !79 -// CHECK:STDOUT: %.loc11_11.2 = load i32, ptr %.loc11_11.1.m, align 4, !dbg !79 -// CHECK:STDOUT: ret i32 %.loc11_11.2, !dbg !80 +// CHECK:STDOUT: %.loc11_11.1.m = getelementptr inbounds nuw [4 x i8], ptr %a, i32 0, i32 0, !dbg !80 +// CHECK:STDOUT: %.loc11_11.2 = load i32, ptr %.loc11_11.1.m, align 4, !dbg !80 +// CHECK:STDOUT: ret i32 %.loc11_11.2, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!65} -// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!47} +// CHECK:STDOUT: !llvm.dbg.cu = !{!66} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !43, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -251,26 +253,27 @@ fn AccessP(a: Cpp.AnonUnionA) -> i32 { // CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !22 = !{!20, !21} // CHECK:STDOUT: !23 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} -// CHECK:STDOUT: !45 = !{!"int", !44, i64 0} -// CHECK:STDOUT: !46 = !{!"__libc_errno", !45, i64 0} -// CHECK:STDOUT: !47 = !{!46, !45, i64 0} -// CHECK:STDOUT: !64 = !DIFile(filename: "access_union.carbon", directory: "") -// CHECK:STDOUT: !65 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !64, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !64, line: 6, type: !23, spFlags: DISPFlagDefinition, unit: !65, retainedNodes: !73) -// CHECK:STDOUT: !67 = !DILocalVariable(arg: 1, scope: !66, type: !21) -// CHECK:STDOUT: !71 = !DILocation(line: 7, column: 10, scope: !66) -// CHECK:STDOUT: !72 = !DILocation(line: 7, column: 3, scope: !66) -// CHECK:STDOUT: !73 = !{!67} -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "AccessM", linkageName: "_CAccessM.Main", scope: null, file: !64, line: 10, type: !23, spFlags: DISPFlagDefinition, unit: !65, retainedNodes: !81) -// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !21) -// CHECK:STDOUT: !79 = !DILocation(line: 11, column: 10, scope: !74) -// CHECK:STDOUT: !80 = !DILocation(line: 11, column: 3, scope: !74) -// CHECK:STDOUT: !81 = !{!75} +// CHECK:STDOUT: !40 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !44 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !45 = !{!"omnipotent char", !44, i64 0} +// CHECK:STDOUT: !46 = !{!"int", !45, i64 0} +// CHECK:STDOUT: !47 = !{!"__libc_errno", !46, i64 0} +// CHECK:STDOUT: !48 = !{!47, !46, i64 0} +// CHECK:STDOUT: !65 = !DIFile(filename: "access_union.carbon", directory: "") +// CHECK:STDOUT: !66 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !65, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !65, line: 6, type: !23, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !74) +// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !21) +// CHECK:STDOUT: !72 = !DILocation(line: 7, column: 10, scope: !67) +// CHECK:STDOUT: !73 = !DILocation(line: 7, column: 3, scope: !67) +// CHECK:STDOUT: !74 = !{!68} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "AccessM", linkageName: "_CAccessM.Main", scope: null, file: !65, line: 10, type: !23, spFlags: DISPFlagDefinition, unit: !66, retainedNodes: !82) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !21) +// CHECK:STDOUT: !80 = !DILocation(line: 11, column: 10, scope: !75) +// CHECK:STDOUT: !81 = !DILocation(line: 11, column: 3, scope: !75) +// CHECK:STDOUT: !82 = !{!76} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'assign_union.carbon' @@ -279,52 +282,53 @@ fn AccessP(a: Cpp.AnonUnionA) -> 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 !84 { +// CHECK:STDOUT: define void @_CAssignN.Main(ptr %p) #0 !dbg !85 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_4.2.n = getelementptr inbounds nuw [4 x i8], ptr %p, i32 0, i32 0, !dbg !87 -// CHECK:STDOUT: store i32 1, ptr %.loc7_4.2.n, align 4, !dbg !87 -// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: %.loc7_4.2.n = getelementptr inbounds nuw [4 x i8], ptr %p, i32 0, i32 0, !dbg !88 +// CHECK:STDOUT: store i32 1, ptr %.loc7_4.2.n, align 4, !dbg !88 +// CHECK:STDOUT: ret void, !dbg !89 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CAssignM.Main(ptr %p) #0 !dbg !90 { +// CHECK:STDOUT: define void @_CAssignM.Main(ptr %p) #0 !dbg !91 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_4.2.m = getelementptr inbounds nuw [4 x i8], ptr %p, i32 0, i32 0, !dbg !93 -// CHECK:STDOUT: store i32 1, ptr %.loc11_4.2.m, align 4, !dbg !93 -// CHECK:STDOUT: ret void, !dbg !94 +// CHECK:STDOUT: %.loc11_4.2.m = getelementptr inbounds nuw [4 x i8], ptr %p, i32 0, i32 0, !dbg !94 +// CHECK:STDOUT: store i32 1, ptr %.loc11_4.2.m, align 4, !dbg !94 +// CHECK:STDOUT: ret void, !dbg !95 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!83} -// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!47} +// CHECK:STDOUT: !llvm.dbg.cu = !{!84} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !43, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} -// CHECK:STDOUT: !45 = !{!"int", !44, i64 0} -// CHECK:STDOUT: !46 = !{!"__libc_errno", !45, i64 0} -// CHECK:STDOUT: !47 = !{!46, !45, i64 0} -// CHECK:STDOUT: !50 = !{null, !21} -// CHECK:STDOUT: !51 = !DISubroutineType(types: !50) -// CHECK:STDOUT: !82 = !DIFile(filename: "assign_union.carbon", directory: "") -// CHECK:STDOUT: !83 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !82, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "AssignN", linkageName: "_CAssignN.Main", scope: null, file: !82, line: 6, type: !51, spFlags: DISPFlagDefinition, unit: !83, retainedNodes: !89) -// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !21) -// CHECK:STDOUT: !87 = !DILocation(line: 7, column: 3, scope: !84) -// CHECK:STDOUT: !88 = !DILocation(line: 6, column: 1, scope: !84) -// CHECK:STDOUT: !89 = !{!85} -// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "AssignM", linkageName: "_CAssignM.Main", scope: null, file: !82, line: 10, type: !51, spFlags: DISPFlagDefinition, unit: !83, retainedNodes: !95) -// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !21) -// CHECK:STDOUT: !93 = !DILocation(line: 11, column: 3, scope: !90) -// CHECK:STDOUT: !94 = !DILocation(line: 10, column: 1, scope: !90) -// CHECK:STDOUT: !95 = !{!91} +// CHECK:STDOUT: !40 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !44 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !45 = !{!"omnipotent char", !44, i64 0} +// CHECK:STDOUT: !46 = !{!"int", !45, i64 0} +// CHECK:STDOUT: !47 = !{!"__libc_errno", !46, i64 0} +// CHECK:STDOUT: !48 = !{!47, !46, i64 0} +// CHECK:STDOUT: !51 = !{null, !21} +// CHECK:STDOUT: !52 = !DISubroutineType(types: !51) +// CHECK:STDOUT: !83 = !DIFile(filename: "assign_union.carbon", directory: "") +// CHECK:STDOUT: !84 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !83, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "AssignN", linkageName: "_CAssignN.Main", scope: null, file: !83, line: 6, type: !52, spFlags: DISPFlagDefinition, unit: !84, retainedNodes: !90) +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !21) +// CHECK:STDOUT: !88 = !DILocation(line: 7, column: 3, scope: !85) +// CHECK:STDOUT: !89 = !DILocation(line: 6, column: 1, scope: !85) +// CHECK:STDOUT: !90 = !{!86} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "AssignM", linkageName: "_CAssignM.Main", scope: null, file: !83, line: 10, type: !52, spFlags: DISPFlagDefinition, unit: !84, retainedNodes: !96) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !21) +// CHECK:STDOUT: !94 = !DILocation(line: 11, column: 3, scope: !91) +// CHECK:STDOUT: !95 = !DILocation(line: 10, column: 1, scope: !91) +// CHECK:STDOUT: !96 = !{!92} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'access_anon_union.carbon' @@ -333,27 +337,27 @@ fn AccessP(a: Cpp.AnonUnionA) -> 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 !98 { +// CHECK:STDOUT: define i32 @_CAccessN.Main(ptr %a) #0 !dbg !99 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_11.1.n = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 8, !dbg !103 -// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.n, align 4, !dbg !103 -// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !104 +// CHECK:STDOUT: %.loc7_11.1.n = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 8, !dbg !104 +// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.n, align 4, !dbg !104 +// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !105 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CAccessP.Main(ptr %a) #0 !dbg !106 { +// CHECK:STDOUT: define i32 @_CAccessP.Main(ptr %a) #0 !dbg !107 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_12.1.p = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 8, !dbg !111 -// CHECK:STDOUT: %.loc11_12.2 = load ptr, ptr %.loc11_12.1.p, align 8, !dbg !111 -// CHECK:STDOUT: %.loc11_10.2 = load i32, ptr %.loc11_12.2, align 4, !dbg !112 -// CHECK:STDOUT: ret i32 %.loc11_10.2, !dbg !113 +// CHECK:STDOUT: %.loc11_12.1.p = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 8, !dbg !112 +// CHECK:STDOUT: %.loc11_12.2 = load ptr, ptr %.loc11_12.1.p, align 8, !dbg !112 +// CHECK:STDOUT: %.loc11_10.2 = load i32, ptr %.loc11_12.2, align 4, !dbg !113 +// CHECK:STDOUT: ret i32 %.loc11_10.2, !dbg !114 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!97} -// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!47} +// CHECK:STDOUT: !llvm.dbg.cu = !{!98} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !43, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -361,25 +365,26 @@ fn AccessP(a: Cpp.AnonUnionA) -> i32 { // CHECK:STDOUT: !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !22 = !{!20, !21} // CHECK:STDOUT: !23 = !DISubroutineType(types: !22) -// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !43 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !44 = !{!"omnipotent char", !43, i64 0} -// CHECK:STDOUT: !45 = !{!"int", !44, i64 0} -// CHECK:STDOUT: !46 = !{!"__libc_errno", !45, i64 0} -// CHECK:STDOUT: !47 = !{!46, !45, i64 0} -// CHECK:STDOUT: !96 = !DIFile(filename: "access_anon_union.carbon", directory: "") -// CHECK:STDOUT: !97 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !96, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !98 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !96, line: 6, type: !23, spFlags: DISPFlagDefinition, unit: !97, retainedNodes: !105) -// CHECK:STDOUT: !99 = !DILocalVariable(arg: 1, scope: !98, type: !21) -// CHECK:STDOUT: !103 = !DILocation(line: 7, column: 10, scope: !98) -// CHECK:STDOUT: !104 = !DILocation(line: 7, column: 3, scope: !98) -// CHECK:STDOUT: !105 = !{!99} -// CHECK:STDOUT: !106 = distinct !DISubprogram(name: "AccessP", linkageName: "_CAccessP.Main", scope: null, file: !96, line: 10, type: !23, spFlags: DISPFlagDefinition, unit: !97, retainedNodes: !114) -// CHECK:STDOUT: !107 = !DILocalVariable(arg: 1, scope: !106, type: !21) -// CHECK:STDOUT: !111 = !DILocation(line: 11, column: 11, scope: !106) -// CHECK:STDOUT: !112 = !DILocation(line: 11, column: 10, scope: !106) -// CHECK:STDOUT: !113 = !DILocation(line: 11, column: 3, scope: !106) -// CHECK:STDOUT: !114 = !{!107} +// CHECK:STDOUT: !40 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !44 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !45 = !{!"omnipotent char", !44, i64 0} +// CHECK:STDOUT: !46 = !{!"int", !45, i64 0} +// CHECK:STDOUT: !47 = !{!"__libc_errno", !46, i64 0} +// CHECK:STDOUT: !48 = !{!47, !46, i64 0} +// CHECK:STDOUT: !97 = !DIFile(filename: "access_anon_union.carbon", directory: "") +// CHECK:STDOUT: !98 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !97, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "AccessN", linkageName: "_CAccessN.Main", scope: null, file: !97, line: 6, type: !23, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !106) +// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !21) +// CHECK:STDOUT: !104 = !DILocation(line: 7, column: 10, scope: !99) +// CHECK:STDOUT: !105 = !DILocation(line: 7, column: 3, scope: !99) +// CHECK:STDOUT: !106 = !{!100} +// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "AccessP", linkageName: "_CAccessP.Main", scope: null, file: !97, line: 10, type: !23, spFlags: DISPFlagDefinition, unit: !98, retainedNodes: !115) +// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !21) +// CHECK:STDOUT: !112 = !DILocation(line: 11, column: 11, scope: !107) +// CHECK:STDOUT: !113 = !DILocation(line: 11, column: 10, scope: !107) +// CHECK:STDOUT: !114 = !DILocation(line: 11, column: 3, scope: !107) +// CHECK:STDOUT: !115 = !{!108} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/import/inherit.carbon b/toolchain/lower/testdata/interop/cpp/class/import/inherit.carbon index 9ac4decc0888..805e8c16afd9 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/inherit.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/inherit.carbon @@ -156,8 +156,8 @@ fn Run() -> i32 { // CHECK:STDOUT: attributes #4 = { inlinehint 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!65, !66, !67, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!70} +// CHECK:STDOUT: !llvm.module.flags = !{!65, !66, !67, !68, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!71} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -201,10 +201,11 @@ fn Run() -> i32 { // CHECK:STDOUT: !62 = !{!61, !61, i64 0} // CHECK:STDOUT: !63 = !{!"vtable pointer", !58, i64 0} // CHECK:STDOUT: !64 = !{!63, !63, i64 0} -// CHECK:STDOUT: !65 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !66 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !67 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !68 = !{!"int", !59, i64 0} -// CHECK:STDOUT: !69 = !{!"__libc_errno", !68, i64 0} -// CHECK:STDOUT: !70 = !{!69, !68, i64 0} +// CHECK:STDOUT: !65 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !66 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !67 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !68 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !69 = !{!"int", !59, i64 0} +// CHECK:STDOUT: !70 = !{!"__libc_errno", !69, i64 0} +// CHECK:STDOUT: !71 = !{!70, !69, i64 0} // 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 6c656e3a1ae6..ec2c4ced2ede 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/method.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/method.carbon @@ -145,8 +145,8 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: attributes #3 = { 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !48, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -172,11 +172,12 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: !42 = !{} // CHECK:STDOUT: !43 = !{i64 8} // CHECK:STDOUT: !44 = !{!41, !40, i64 8} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !40, i64 0} -// CHECK:STDOUT: !49 = !{!48, !40, i64 0} +// CHECK:STDOUT: !45 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !46 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !47 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !48 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !49 = !{!"__libc_errno", !40, i64 0} +// CHECK:STDOUT: !50 = !{!49, !40, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_by_ref.carbon' @@ -195,10 +196,10 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: @_ZTI4Base = external constant ptr // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CUseVal.Main(ptr %a) #0 !dbg !52 { +// CHECK:STDOUT: define i32 @_CUseVal.Main(ptr %a) #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %A.by_ref.call = call i32 @_ZN1A6by_refEv(ptr %a), !dbg !57 -// CHECK:STDOUT: ret i32 %A.by_ref.call, !dbg !58 +// CHECK:STDOUT: %A.by_ref.call = call i32 @_ZN1A6by_refEv(ptr %a), !dbg !58 +// CHECK:STDOUT: ret i32 %A.by_ref.call, !dbg !59 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN4Base5virt0Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 @@ -223,9 +224,9 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: attributes #2 = { 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!51} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!52} +// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !48, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -242,18 +243,19 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: !40 = !{!"int", !35, i64 0} // CHECK:STDOUT: !41 = !{!"_ZTS1A", !39, i64 0, !40, i64 8} // CHECK:STDOUT: !44 = !{!41, !40, i64 8} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !40, i64 0} -// CHECK:STDOUT: !49 = !{!48, !40, i64 0} -// CHECK:STDOUT: !50 = !DIFile(filename: "call_by_ref.carbon", directory: "") -// CHECK:STDOUT: !51 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !50, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !50, line: 6, type: !23, spFlags: DISPFlagDefinition, unit: !51, retainedNodes: !59) -// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !21) -// CHECK:STDOUT: !57 = !DILocation(line: 7, column: 10, scope: !52) -// CHECK:STDOUT: !58 = !DILocation(line: 7, column: 3, scope: !52) -// CHECK:STDOUT: !59 = !{!53} +// CHECK:STDOUT: !45 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !46 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !47 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !48 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !49 = !{!"__libc_errno", !40, i64 0} +// CHECK:STDOUT: !50 = !{!49, !40, i64 0} +// CHECK:STDOUT: !51 = !DIFile(filename: "call_by_ref.carbon", directory: "") +// CHECK:STDOUT: !52 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !51, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !51, line: 6, type: !23, spFlags: DISPFlagDefinition, unit: !52, retainedNodes: !60) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !21) +// CHECK:STDOUT: !58 = !DILocation(line: 7, column: 10, scope: !53) +// CHECK:STDOUT: !59 = !DILocation(line: 7, column: 3, scope: !53) +// CHECK:STDOUT: !60 = !{!54} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_virtual.carbon' @@ -267,18 +269,18 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: @_ZTI4Base = external constant ptr // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CUseVal.Main(ptr %a) #0 !dbg !62 { +// CHECK:STDOUT: define void @_CUseVal.Main(ptr %a) #0 !dbg !63 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_4.2.base = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 0, !dbg !65 -// CHECK:STDOUT: %Base.virt0.call.vtable = load ptr, ptr %.loc7_4.2.base, align 8, !dbg !65 -// CHECK:STDOUT: %Base.virt0.call = getelementptr ptr, ptr %Base.virt0.call.vtable, i32 0, !dbg !65 -// CHECK:STDOUT: %Base.virt0.call.memptr.virtualfn = load ptr, ptr %Base.virt0.call, align 8, !dbg !65 -// CHECK:STDOUT: call void %Base.virt0.call.memptr.virtualfn(ptr %.loc7_4.2.base), !dbg !65 -// CHECK:STDOUT: %A.virt1.call.vtable = load ptr, ptr %a, align 8, !dbg !66 -// CHECK:STDOUT: %A.virt1.call = getelementptr ptr, ptr %A.virt1.call.vtable, i32 1, !dbg !66 -// CHECK:STDOUT: %A.virt1.call.memptr.virtualfn = load ptr, ptr %A.virt1.call, align 8, !dbg !66 -// CHECK:STDOUT: call void %A.virt1.call.memptr.virtualfn(ptr %a), !dbg !66 -// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: %.loc7_4.2.base = getelementptr inbounds nuw [16 x i8], ptr %a, i32 0, i32 0, !dbg !66 +// CHECK:STDOUT: %Base.virt0.call.vtable = load ptr, ptr %.loc7_4.2.base, align 8, !dbg !66 +// CHECK:STDOUT: %Base.virt0.call = getelementptr ptr, ptr %Base.virt0.call.vtable, i32 0, !dbg !66 +// CHECK:STDOUT: %Base.virt0.call.memptr.virtualfn = load ptr, ptr %Base.virt0.call, align 8, !dbg !66 +// CHECK:STDOUT: call void %Base.virt0.call.memptr.virtualfn(ptr %.loc7_4.2.base), !dbg !66 +// CHECK:STDOUT: %A.virt1.call.vtable = load ptr, ptr %a, align 8, !dbg !67 +// CHECK:STDOUT: %A.virt1.call = getelementptr ptr, ptr %A.virt1.call.vtable, i32 1, !dbg !67 +// CHECK:STDOUT: %A.virt1.call.memptr.virtualfn = load ptr, ptr %A.virt1.call, align 8, !dbg !67 +// CHECK:STDOUT: call void %A.virt1.call.memptr.virtualfn(ptr %a), !dbg !67 +// CHECK:STDOUT: ret void, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN4Base5virt0Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 @@ -291,9 +293,9 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!61} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!62} +// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !48, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -303,19 +305,20 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: !34 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !35 = !{!"omnipotent char", !34, i64 0} // CHECK:STDOUT: !40 = !{!"int", !35, i64 0} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !40, i64 0} -// CHECK:STDOUT: !49 = !{!48, !40, i64 0} -// CHECK:STDOUT: !60 = !DIFile(filename: "call_virtual.carbon", directory: "") -// CHECK:STDOUT: !61 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !60, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !60, line: 6, type: !25, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !68) -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !21) -// CHECK:STDOUT: !65 = !DILocation(line: 7, column: 3, scope: !62) -// CHECK:STDOUT: !66 = !DILocation(line: 8, column: 3, scope: !62) -// CHECK:STDOUT: !67 = !DILocation(line: 6, column: 1, scope: !62) -// CHECK:STDOUT: !68 = !{!63} +// CHECK:STDOUT: !45 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !46 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !47 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !48 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !49 = !{!"__libc_errno", !40, i64 0} +// CHECK:STDOUT: !50 = !{!49, !40, i64 0} +// CHECK:STDOUT: !61 = !DIFile(filename: "call_virtual.carbon", directory: "") +// CHECK:STDOUT: !62 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !61, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "UseVal", linkageName: "_CUseVal.Main", scope: null, file: !61, line: 6, type: !25, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !69) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !21) +// CHECK:STDOUT: !66 = !DILocation(line: 7, column: 3, scope: !63) +// CHECK:STDOUT: !67 = !DILocation(line: 8, column: 3, scope: !63) +// CHECK:STDOUT: !68 = !DILocation(line: 6, column: 1, scope: !63) +// CHECK:STDOUT: !69 = !{!64} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_thunk.carbon' @@ -328,17 +331,17 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: @int_1.2eb = internal constant i8 1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCall.Main(ptr %n) #0 !dbg !74 { +// CHECK:STDOUT: define void @_CCall.Main(ptr %n) #0 !dbg !75 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_14.3.temp = alloca i8, align 1, !dbg !78 -// CHECK:STDOUT: %.loc8_14.3.temp = alloca i8, align 1, !dbg !82 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_14.3.temp), !dbg !78 -// CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk.__(ptr %n, ptr @int_1.2eb), !dbg !77 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.6fb12317fdf5c9b3(ptr @int_1.2eb), !dbg !78 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_14.3.temp), !dbg !82 -// CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk.__(ptr %n, ptr @int_1.2eb), !dbg !81 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.6fb12317fdf5c9b3(ptr @int_1.2eb), !dbg !82 -// CHECK:STDOUT: ret void, !dbg !83 +// CHECK:STDOUT: %.loc7_14.3.temp = alloca i8, align 1, !dbg !79 +// CHECK:STDOUT: %.loc8_14.3.temp = alloca i8, align 1, !dbg !83 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_14.3.temp), !dbg !79 +// CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa.carbon_thunk.__(ptr %n, ptr @int_1.2eb), !dbg !78 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.6fb12317fdf5c9b3(ptr @int_1.2eb), !dbg !79 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc8_14.3.temp), !dbg !83 +// CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a.carbon_thunk.__(ptr %n, ptr @int_1.2eb), !dbg !82 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.6fb12317fdf5c9b3(ptr @int_1.2eb), !dbg !83 +// CHECK:STDOUT: ret void, !dbg !84 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -346,11 +349,11 @@ fn F(ref r: Cpp.RefSelfA) { // 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 !93 -// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !95 -// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !93, !nonnull !42 -// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8, !tbaa !95 -// CHECK:STDOUT: %2 = load i8, ptr %1, align 1, !tbaa !97 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !94 +// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !96 +// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !94, !nonnull !42 +// CHECK:STDOUT: %1 = load ptr, ptr %c.addr, align 8, !tbaa !96 +// CHECK:STDOUT: %2 = load i8, ptr %1, align 1, !tbaa !98 // CHECK:STDOUT: call void @_ZNK9NeedThunk8ImplicitEa(ptr noundef nonnull align 1 dereferenceable(1) %0, i8 noundef signext %2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -361,11 +364,11 @@ fn F(ref r: Cpp.RefSelfA) { // 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 !93 -// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !95 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !93 -// CHECK:STDOUT: %2 = load ptr, ptr %c.addr, align 8, !tbaa !95 -// CHECK:STDOUT: %3 = load i8, ptr %2, align 1, !tbaa !97 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !94 +// CHECK:STDOUT: store ptr %c, ptr %c.addr, align 8, !tbaa !96 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !94 +// CHECK:STDOUT: %2 = load ptr, ptr %c.addr, align 8, !tbaa !96 +// CHECK:STDOUT: %3 = load i8, ptr %2, align 1, !tbaa !98 // CHECK:STDOUT: call void @_ZNH9NeedThunk8ExplicitES_a(i8 noundef signext %3) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -374,8 +377,8 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.6fb12317fdf5c9b3(ptr %t) #0 !dbg !85 { -// CHECK:STDOUT: ret void, !dbg !90 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.6fb12317fdf5c9b3(ptr %t) #0 !dbg !86 { +// CHECK:STDOUT: ret void, !dbg !91 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZNK9NeedThunk8ImplicitEa(ptr noundef nonnull align 1 dereferenceable(1), i8 noundef signext) #3 @@ -391,9 +394,9 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!70} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!71} +// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !48, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -406,33 +409,34 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: !36 = !{!"any pointer", !35, i64 0} // CHECK:STDOUT: !40 = !{!"int", !35, i64 0} // CHECK:STDOUT: !42 = !{} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !40, i64 0} -// CHECK:STDOUT: !49 = !{!48, !40, i64 0} -// CHECK:STDOUT: !69 = !DIFile(filename: "call_thunk.carbon", directory: "") -// CHECK:STDOUT: !70 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !69, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !71 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed) -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !69, line: 6, type: !25, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !84) -// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !21) -// CHECK:STDOUT: !77 = !DILocation(line: 7, column: 3, scope: !74) -// CHECK:STDOUT: !78 = !DILocation(line: 7, column: 14, scope: !74) -// CHECK:STDOUT: !79 = !{null, !71} -// CHECK:STDOUT: !80 = !DISubroutineType(types: !79) -// CHECK:STDOUT: !81 = !DILocation(line: 8, column: 3, scope: !74) -// CHECK:STDOUT: !82 = !DILocation(line: 8, column: 14, scope: !74) -// CHECK:STDOUT: !83 = !DILocation(line: 6, column: 1, scope: !74) -// CHECK:STDOUT: !84 = !{!75} -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.6fb12317fdf5c9b3", scope: null, file: !10, line: 32, type: !80, spFlags: DISPFlagDefinition, unit: !70, retainedNodes: !91) -// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !71) -// CHECK:STDOUT: !90 = !DILocation(line: 32, column: 1, scope: !85) -// CHECK:STDOUT: !91 = !{!86} -// CHECK:STDOUT: !92 = !{!"p1 _ZTS9NeedThunk", !36, i64 0} -// CHECK:STDOUT: !93 = !{!92, !92, i64 0} -// CHECK:STDOUT: !94 = !{!"p1 omnipotent char", !36, i64 0} -// CHECK:STDOUT: !95 = !{!94, !94, i64 0} -// CHECK:STDOUT: !97 = !{!35, !35, i64 0} +// CHECK:STDOUT: !45 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !46 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !47 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !48 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !49 = !{!"__libc_errno", !40, i64 0} +// CHECK:STDOUT: !50 = !{!49, !40, i64 0} +// CHECK:STDOUT: !70 = !DIFile(filename: "call_thunk.carbon", directory: "") +// CHECK:STDOUT: !71 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !70, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !72 = !DIBasicType(name: "int", size: 8, encoding: DW_ATE_signed) +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !70, line: 6, type: !25, spFlags: DISPFlagDefinition, unit: !71, retainedNodes: !85) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !21) +// CHECK:STDOUT: !78 = !DILocation(line: 7, column: 3, scope: !75) +// CHECK:STDOUT: !79 = !DILocation(line: 7, column: 14, scope: !75) +// CHECK:STDOUT: !80 = !{null, !72} +// CHECK:STDOUT: !81 = !DISubroutineType(types: !80) +// CHECK:STDOUT: !82 = !DILocation(line: 8, column: 3, scope: !75) +// CHECK:STDOUT: !83 = !DILocation(line: 8, column: 14, scope: !75) +// CHECK:STDOUT: !84 = !DILocation(line: 6, column: 1, scope: !75) +// CHECK:STDOUT: !85 = !{!76} +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.6fb12317fdf5c9b3", scope: null, file: !10, line: 32, type: !81, spFlags: DISPFlagDefinition, unit: !71, retainedNodes: !92) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !72) +// CHECK:STDOUT: !91 = !DILocation(line: 32, column: 1, scope: !86) +// CHECK:STDOUT: !92 = !{!87} +// CHECK:STDOUT: !93 = !{!"p1 _ZTS9NeedThunk", !36, i64 0} +// CHECK:STDOUT: !94 = !{!93, !93, i64 0} +// CHECK:STDOUT: !95 = !{!"p1 omnipotent char", !36, i64 0} +// CHECK:STDOUT: !96 = !{!95, !95, i64 0} +// CHECK:STDOUT: !98 = !{!35, !35, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_with_ref_self.carbon' @@ -441,10 +445,10 @@ fn F(ref r: Cpp.RefSelfA) { // 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 !102 { +// CHECK:STDOUT: define void @_CF.Main(ptr %r) #0 !dbg !103 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN8RefSelfA1fEii(ptr %r, i32 1, i32 2), !dbg !105 -// CHECK:STDOUT: ret void, !dbg !106 +// CHECK:STDOUT: call void @_ZN8RefSelfA1fEii(ptr %r, i32 1, i32 2), !dbg !106 +// CHECK:STDOUT: ret void, !dbg !107 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN8RefSelfA1fEii(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, i32 noundef) #1 @@ -452,9 +456,9 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!99} -// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!100} +// CHECK:STDOUT: !llvm.module.flags = !{!45, !46, !47, !48, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -464,16 +468,17 @@ fn F(ref r: Cpp.RefSelfA) { // CHECK:STDOUT: !34 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !35 = !{!"omnipotent char", !34, i64 0} // CHECK:STDOUT: !40 = !{!"int", !35, i64 0} -// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !40, i64 0} -// CHECK:STDOUT: !49 = !{!48, !40, i64 0} -// CHECK:STDOUT: !98 = !DIFile(filename: "call_with_ref_self.carbon", directory: "") -// CHECK:STDOUT: !99 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !98, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !98, line: 11, type: !25, spFlags: DISPFlagDefinition, unit: !99, retainedNodes: !107) -// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !102, type: !21) -// CHECK:STDOUT: !105 = !DILocation(line: 12, column: 3, scope: !102) -// CHECK:STDOUT: !106 = !DILocation(line: 11, column: 1, scope: !102) -// CHECK:STDOUT: !107 = !{!103} +// CHECK:STDOUT: !45 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !46 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !47 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !48 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !49 = !{!"__libc_errno", !40, i64 0} +// CHECK:STDOUT: !50 = !{!49, !40, i64 0} +// CHECK:STDOUT: !99 = !DIFile(filename: "call_with_ref_self.carbon", directory: "") +// CHECK:STDOUT: !100 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !99, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !99, line: 11, type: !25, spFlags: DISPFlagDefinition, unit: !100, retainedNodes: !108) +// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !21) +// CHECK:STDOUT: !106 = !DILocation(line: 12, column: 3, scope: !103) +// CHECK:STDOUT: !107 = !DILocation(line: 11, column: 1, scope: !103) +// CHECK:STDOUT: !108 = !{!104} // 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 40321f72f8a9..18dba0076db4 100644 --- a/toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon @@ -194,8 +194,8 @@ fn AccessD(d: Cpp.D) -> i32 { // CHECK:STDOUT: attributes #4 = { "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!55, !56, !57, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!60} +// CHECK:STDOUT: !llvm.module.flags = !{!55, !56, !57, !58, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!61} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -230,10 +230,11 @@ fn AccessD(d: Cpp.D) -> i32 { // CHECK:STDOUT: !52 = !{!51, !51, i64 0} // CHECK:STDOUT: !53 = !{!"vtable pointer", !48, i64 0} // CHECK:STDOUT: !54 = !{!53, !53, i64 0} -// CHECK:STDOUT: !55 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !56 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !57 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !58 = !{!"int", !49, i64 0} -// CHECK:STDOUT: !59 = !{!"__libc_errno", !58, i64 0} -// CHECK:STDOUT: !60 = !{!59, !58, i64 0} +// CHECK:STDOUT: !55 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !56 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !57 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !58 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !59 = !{!"int", !49, i64 0} +// CHECK:STDOUT: !60 = !{!"__libc_errno", !59, i64 0} +// CHECK:STDOUT: !61 = !{!60, !59, 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 a919b73703d6..19176df8384f 100644 --- a/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/virtual_fn.carbon @@ -385,8 +385,8 @@ void delete_new_Base() { // CHECK:STDOUT: attributes #12 = { builtin nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!28} -// CHECK:STDOUT: !llvm.module.flags = !{!98, !99, !100, !11, !12} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!103} +// CHECK:STDOUT: !llvm.module.flags = !{!98, !99, !100, !101, !11, !12} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!104} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -460,10 +460,11 @@ void delete_new_Base() { // CHECK:STDOUT: !92 = !{!91, !91, i64 0} // CHECK:STDOUT: !95 = !{} // CHECK:STDOUT: !96 = !{i64 8} -// CHECK:STDOUT: !98 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !99 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !100 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !101 = !{!"int", !1, i64 0} -// CHECK:STDOUT: !102 = !{!"__libc_errno", !101, i64 0} -// CHECK:STDOUT: !103 = !{!102, !101, i64 0} +// CHECK:STDOUT: !98 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !99 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !100 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !101 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !102 = !{!"int", !1, i64 0} +// CHECK:STDOUT: !103 = !{!"__libc_errno", !102, i64 0} +// CHECK:STDOUT: !104 = !{!103, !102, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/class/virtual_fn_carbon_only.carbon b/toolchain/lower/testdata/interop/cpp/class/virtual_fn_carbon_only.carbon index e466f922e58c..efc733b6f77a 100644 --- a/toolchain/lower/testdata/interop/cpp/class/virtual_fn_carbon_only.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/virtual_fn_carbon_only.carbon @@ -178,8 +178,8 @@ fn F() { // CHECK:STDOUT: attributes #6 = { inlinehint 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!13} -// CHECK:STDOUT: !llvm.module.flags = !{!76, !77, !78, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!81} +// CHECK:STDOUT: !llvm.module.flags = !{!76, !77, !78, !79, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!82} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -238,10 +238,11 @@ fn F() { // CHECK:STDOUT: !71 = !{!70, !70, i64 0} // CHECK:STDOUT: !72 = !{!"p1 _ZTSN6Carbon4Main1ZE", !67, i64 0} // CHECK:STDOUT: !73 = !{!72, !72, i64 0} -// CHECK:STDOUT: !76 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !77 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !78 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !79 = !{!"int", !66, i64 0} -// CHECK:STDOUT: !80 = !{!"__libc_errno", !79, i64 0} -// CHECK:STDOUT: !81 = !{!80, !79, i64 0} +// CHECK:STDOUT: !76 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !77 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !78 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !79 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !80 = !{!"int", !66, i64 0} +// CHECK:STDOUT: !81 = !{!"__libc_errno", !80, i64 0} +// CHECK:STDOUT: !82 = !{!81, !80, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/debug_info.carbon b/toolchain/lower/testdata/interop/cpp/debug_info.carbon index f67fb8d97e2f..b62ce021d571 100644 --- a/toolchain/lower/testdata/interop/cpp/debug_info.carbon +++ b/toolchain/lower/testdata/interop/cpp/debug_info.carbon @@ -45,8 +45,8 @@ fn Call() -> i32 { // CHECK:STDOUT: attributes #1 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!1, !30} -// CHECK:STDOUT: !llvm.module.flags = !{!14, !15, !36, !37, !38} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!43} +// CHECK:STDOUT: !llvm.module.flags = !{!14, !15, !36, !37, !38, !39} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!44} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !DIFile(filename: "", directory: "", checksumkind: CSK_MD5, checksum: "9eecb7db59d16c80417c72d1e1f4fbf1") // CHECK:STDOUT: !1 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !0, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) @@ -62,12 +62,13 @@ fn Call() -> i32 { // CHECK:STDOUT: !31 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !2, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !30) // CHECK:STDOUT: !34 = !DILocation(line: 22, column: 10, scope: !31) // CHECK:STDOUT: !35 = !DILocation(line: 22, column: 3, scope: !31) -// CHECK:STDOUT: !36 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !37 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !38 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !39 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !40 = !{!"omnipotent char", !39, i64 0} -// CHECK:STDOUT: !41 = !{!"int", !40, i64 0} -// CHECK:STDOUT: !42 = !{!"__libc_errno", !41, i64 0} -// CHECK:STDOUT: !43 = !{!42, !41, i64 0} +// CHECK:STDOUT: !36 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !37 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !38 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !39 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !40 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !41 = !{!"omnipotent char", !40, i64 0} +// CHECK:STDOUT: !42 = !{!"int", !41, i64 0} +// CHECK:STDOUT: !43 = !{!"__libc_errno", !42, i64 0} +// CHECK:STDOUT: !44 = !{!43, !42, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/enum.carbon b/toolchain/lower/testdata/interop/cpp/enum.carbon index b844d35be92f..b5d78044ac28 100644 --- a/toolchain/lower/testdata/interop/cpp/enum.carbon +++ b/toolchain/lower/testdata/interop/cpp/enum.carbon @@ -232,8 +232,8 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: attributes #3 = { "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !47, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -271,12 +271,13 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: !41 = !{!40, !40, i64 0} // CHECK:STDOUT: !42 = !{!"_ZTSN1C1EE", !39, i64 0} // CHECK:STDOUT: !43 = !{!42, !42, i64 0} -// CHECK:STDOUT: !44 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !45 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !47 = !{!"int", !39, i64 0} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !47, i64 0} -// CHECK:STDOUT: !49 = !{!48, !47, i64 0} +// CHECK:STDOUT: !44 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !48 = !{!"int", !39, i64 0} +// CHECK:STDOUT: !49 = !{!"__libc_errno", !48, i64 0} +// CHECK:STDOUT: !50 = !{!49, !48, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'convert.carbon' @@ -287,28 +288,28 @@ 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 !52 { +// CHECK:STDOUT: define void @_CPassEnum.Main() #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CTakeI16.Main(i16 7), !dbg !53 -// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: call void @_CTakeI16.Main(i16 7), !dbg !54 +// CHECK:STDOUT: ret void, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertEnumToI16.Main(i16 %e) #0 !dbg !55 { +// CHECK:STDOUT: define void @_CConvertEnumToI16.Main(i16 %e) #0 !dbg !56 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CTakeI16.Main(i16 %e), !dbg !59 -// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: call void @_CTakeI16.Main(i16 %e), !dbg !60 +// CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CConvertI16ToEnum.Main(i16 %n) #0 !dbg !62 { +// CHECK:STDOUT: define void @_CConvertI16ToEnum.Main(i16 %n) #0 !dbg !63 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_13.3.temp = alloca i16, align 2, !dbg !65 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_13.3.temp), !dbg !65 -// CHECK:STDOUT: store i16 %n, ptr %.loc17_13.3.temp, align 2, !dbg !65 -// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr %.loc17_13.3.temp), !dbg !66 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.loc17_13.3.temp), !dbg !65 -// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: %.loc17_13.3.temp = alloca i16, align 2, !dbg !66 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_13.3.temp), !dbg !66 +// CHECK:STDOUT: store i16 %n, ptr %.loc17_13.3.temp, align 2, !dbg !66 +// CHECK:STDOUT: call void @_ZN1C1FENS_1EE.carbon_thunk._(ptr %.loc17_13.3.temp), !dbg !67 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.loc17_13.3.temp), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -326,8 +327,8 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %t) #0 !dbg !69 { -// CHECK:STDOUT: ret void, !dbg !74 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %t) #0 !dbg !70 { +// CHECK:STDOUT: ret void, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN1C1FENS_1EE(i16 noundef signext) #3 @@ -337,9 +338,9 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!51} -// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!52} +// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !47, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -355,32 +356,33 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: !41 = !{!40, !40, i64 0} // CHECK:STDOUT: !42 = !{!"_ZTSN1C1EE", !39, i64 0} // CHECK:STDOUT: !43 = !{!42, !42, i64 0} -// CHECK:STDOUT: !44 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !45 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !47 = !{!"int", !39, i64 0} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !47, i64 0} -// CHECK:STDOUT: !49 = !{!48, !47, i64 0} -// CHECK:STDOUT: !50 = !DIFile(filename: "convert.carbon", directory: "") -// CHECK:STDOUT: !51 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !50, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "PassEnum", linkageName: "_CPassEnum.Main", scope: null, file: !50, line: 8, type: !8, spFlags: DISPFlagDefinition, unit: !51) -// CHECK:STDOUT: !53 = !DILocation(line: 9, column: 3, scope: !52) -// CHECK:STDOUT: !54 = !DILocation(line: 8, column: 1, scope: !52) -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "ConvertEnumToI16", linkageName: "_CConvertEnumToI16.Main", scope: null, file: !50, line: 12, type: !16, spFlags: DISPFlagDefinition, unit: !51, retainedNodes: !61) -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !6) -// CHECK:STDOUT: !59 = !DILocation(line: 13, column: 3, scope: !55) -// CHECK:STDOUT: !60 = !DILocation(line: 12, column: 1, scope: !55) -// CHECK:STDOUT: !61 = !{!56} -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "ConvertI16ToEnum", linkageName: "_CConvertI16ToEnum.Main", scope: null, file: !50, line: 16, type: !16, spFlags: DISPFlagDefinition, unit: !51, retainedNodes: !68) -// CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !62, type: !6) -// CHECK:STDOUT: !65 = !DILocation(line: 17, column: 11, scope: !62) -// CHECK:STDOUT: !66 = !DILocation(line: 17, column: 3, scope: !62) -// CHECK:STDOUT: !67 = !DILocation(line: 16, column: 1, scope: !62) -// CHECK:STDOUT: !68 = !{!63} -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.dd9c146f84d40ff5", scope: null, file: !30, line: 36, type: !16, spFlags: DISPFlagDefinition, unit: !51, retainedNodes: !75) -// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !6) -// CHECK:STDOUT: !74 = !DILocation(line: 36, column: 1, scope: !69) -// CHECK:STDOUT: !75 = !{!70} +// CHECK:STDOUT: !44 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !48 = !{!"int", !39, i64 0} +// CHECK:STDOUT: !49 = !{!"__libc_errno", !48, i64 0} +// CHECK:STDOUT: !50 = !{!49, !48, i64 0} +// CHECK:STDOUT: !51 = !DIFile(filename: "convert.carbon", directory: "") +// CHECK:STDOUT: !52 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !51, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "PassEnum", linkageName: "_CPassEnum.Main", scope: null, file: !51, line: 8, type: !8, spFlags: DISPFlagDefinition, unit: !52) +// CHECK:STDOUT: !54 = !DILocation(line: 9, column: 3, scope: !53) +// CHECK:STDOUT: !55 = !DILocation(line: 8, column: 1, scope: !53) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "ConvertEnumToI16", linkageName: "_CConvertEnumToI16.Main", scope: null, file: !51, line: 12, type: !16, spFlags: DISPFlagDefinition, unit: !52, retainedNodes: !62) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !6) +// CHECK:STDOUT: !60 = !DILocation(line: 13, column: 3, scope: !56) +// CHECK:STDOUT: !61 = !DILocation(line: 12, column: 1, scope: !56) +// CHECK:STDOUT: !62 = !{!57} +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "ConvertI16ToEnum", linkageName: "_CConvertI16ToEnum.Main", scope: null, file: !51, line: 16, type: !16, spFlags: DISPFlagDefinition, unit: !52, retainedNodes: !69) +// CHECK:STDOUT: !64 = !DILocalVariable(arg: 1, scope: !63, type: !6) +// CHECK:STDOUT: !66 = !DILocation(line: 17, column: 11, scope: !63) +// CHECK:STDOUT: !67 = !DILocation(line: 17, column: 3, scope: !63) +// CHECK:STDOUT: !68 = !DILocation(line: 16, column: 1, scope: !63) +// CHECK:STDOUT: !69 = !{!64} +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.dd9c146f84d40ff5", scope: null, file: !30, line: 36, type: !16, spFlags: DISPFlagDefinition, unit: !52, retainedNodes: !76) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !6) +// CHECK:STDOUT: !75 = !DILocation(line: 36, column: 1, scope: !70) +// CHECK:STDOUT: !76 = !{!71} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'use_bitmask.carbon' @@ -389,29 +391,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 !83 { +// CHECK:STDOUT: define void @_CCompileTime.Main() #0 !dbg !84 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 0), !dbg !84 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 5), !dbg !85 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 0), !dbg !85 // CHECK:STDOUT: call void @_Z4Take4Bits(i32 5), !dbg !86 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 -2), !dbg !87 -// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 5), !dbg !87 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 -2), !dbg !88 +// CHECK:STDOUT: ret void, !dbg !89 // 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 !89 { +// CHECK:STDOUT: define void @_CRuntime.Main(i32 %a, i32 %b) #0 !dbg !90 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %BitAndWith.WithSelf.Op.call = and i32 %a, %b, !dbg !94 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitAndWith.WithSelf.Op.call), !dbg !96 -// CHECK:STDOUT: %BitOrWith.WithSelf.Op.call = or i32 %a, %b, !dbg !97 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitOrWith.WithSelf.Op.call), !dbg !99 -// CHECK:STDOUT: %BitXorWith.WithSelf.Op.call = xor i32 %a, %b, !dbg !100 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitXorWith.WithSelf.Op.call), !dbg !102 -// CHECK:STDOUT: %BitComplement.WithSelf.Op.call = xor i32 -1, %a, !dbg !104 -// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitComplement.WithSelf.Op.call), !dbg !105 -// CHECK:STDOUT: ret void, !dbg !106 +// CHECK:STDOUT: %BitAndWith.WithSelf.Op.call = and i32 %a, %b, !dbg !95 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitAndWith.WithSelf.Op.call), !dbg !97 +// CHECK:STDOUT: %BitOrWith.WithSelf.Op.call = or i32 %a, %b, !dbg !98 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitOrWith.WithSelf.Op.call), !dbg !100 +// CHECK:STDOUT: %BitXorWith.WithSelf.Op.call = xor i32 %a, %b, !dbg !101 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitXorWith.WithSelf.Op.call), !dbg !103 +// CHECK:STDOUT: %BitComplement.WithSelf.Op.call = xor i32 -1, %a, !dbg !105 +// CHECK:STDOUT: call void @_Z4Take4Bits(i32 %BitComplement.WithSelf.Op.call), !dbg !106 +// CHECK:STDOUT: ret void, !dbg !107 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -420,9 +422,9 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!77} -// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!78} +// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !47, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -430,36 +432,37 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: !8 = !DISubroutineType(types: !7) // CHECK:STDOUT: !38 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !39 = !{!"omnipotent char", !38, i64 0} -// CHECK:STDOUT: !44 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !45 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !47 = !{!"int", !39, i64 0} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !47, i64 0} -// CHECK:STDOUT: !49 = !{!48, !47, i64 0} -// CHECK:STDOUT: !76 = !DIFile(filename: "use_bitmask.carbon", directory: "") -// CHECK:STDOUT: !77 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !76, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !78 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) -// CHECK:STDOUT: !81 = !{null, !78, !78} -// CHECK:STDOUT: !82 = !DISubroutineType(types: !81) -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "CompileTime", linkageName: "_CCompileTime.Main", scope: null, file: !76, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !77) -// CHECK:STDOUT: !84 = !DILocation(line: 7, column: 3, scope: !83) -// CHECK:STDOUT: !85 = !DILocation(line: 8, column: 3, scope: !83) -// CHECK:STDOUT: !86 = !DILocation(line: 9, column: 3, scope: !83) -// CHECK:STDOUT: !87 = !DILocation(line: 10, column: 3, scope: !83) -// CHECK:STDOUT: !88 = !DILocation(line: 6, column: 1, scope: !83) -// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "Runtime", linkageName: "_CRuntime.Main", scope: null, file: !76, line: 13, type: !82, spFlags: DISPFlagDefinition, unit: !77, retainedNodes: !107) -// CHECK:STDOUT: !90 = !DILocalVariable(arg: 1, scope: !89, type: !78) -// CHECK:STDOUT: !91 = !DILocalVariable(arg: 2, scope: !89, type: !78) -// CHECK:STDOUT: !94 = !DILocation(line: 14, column: 12, scope: !89) -// CHECK:STDOUT: !96 = !DILocation(line: 14, column: 3, scope: !89) -// CHECK:STDOUT: !97 = !DILocation(line: 15, column: 12, scope: !89) -// CHECK:STDOUT: !99 = !DILocation(line: 15, column: 3, scope: !89) -// CHECK:STDOUT: !100 = !DILocation(line: 16, column: 12, scope: !89) -// CHECK:STDOUT: !102 = !DILocation(line: 16, column: 3, scope: !89) -// CHECK:STDOUT: !104 = !DILocation(line: 20, column: 12, scope: !89) -// CHECK:STDOUT: !105 = !DILocation(line: 20, column: 3, scope: !89) -// CHECK:STDOUT: !106 = !DILocation(line: 13, column: 1, scope: !89) -// CHECK:STDOUT: !107 = !{!90, !91} +// CHECK:STDOUT: !44 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !48 = !{!"int", !39, i64 0} +// CHECK:STDOUT: !49 = !{!"__libc_errno", !48, i64 0} +// CHECK:STDOUT: !50 = !{!49, !48, i64 0} +// CHECK:STDOUT: !77 = !DIFile(filename: "use_bitmask.carbon", directory: "") +// CHECK:STDOUT: !78 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !77, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !79 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !82 = !{null, !79, !79} +// CHECK:STDOUT: !83 = !DISubroutineType(types: !82) +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "CompileTime", linkageName: "_CCompileTime.Main", scope: null, file: !77, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !78) +// CHECK:STDOUT: !85 = !DILocation(line: 7, column: 3, scope: !84) +// CHECK:STDOUT: !86 = !DILocation(line: 8, column: 3, scope: !84) +// CHECK:STDOUT: !87 = !DILocation(line: 9, column: 3, scope: !84) +// CHECK:STDOUT: !88 = !DILocation(line: 10, column: 3, scope: !84) +// CHECK:STDOUT: !89 = !DILocation(line: 6, column: 1, scope: !84) +// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Runtime", linkageName: "_CRuntime.Main", scope: null, file: !77, line: 13, type: !83, spFlags: DISPFlagDefinition, unit: !78, retainedNodes: !108) +// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !79) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 2, scope: !90, type: !79) +// CHECK:STDOUT: !95 = !DILocation(line: 14, column: 12, scope: !90) +// CHECK:STDOUT: !97 = !DILocation(line: 14, column: 3, scope: !90) +// CHECK:STDOUT: !98 = !DILocation(line: 15, column: 12, scope: !90) +// CHECK:STDOUT: !100 = !DILocation(line: 15, column: 3, scope: !90) +// CHECK:STDOUT: !101 = !DILocation(line: 16, column: 12, scope: !90) +// CHECK:STDOUT: !103 = !DILocation(line: 16, column: 3, scope: !90) +// CHECK:STDOUT: !105 = !DILocation(line: 20, column: 12, scope: !90) +// CHECK:STDOUT: !106 = !DILocation(line: 20, column: 3, scope: !90) +// CHECK:STDOUT: !107 = !DILocation(line: 13, column: 1, scope: !90) +// CHECK:STDOUT: !108 = !{!91, !92} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'compare.carbon' @@ -468,31 +471,31 @@ 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 !112 { +// CHECK:STDOUT: define i1 @_CCompare.Main(i16 %a, i16 %b) #0 !dbg !113 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %a, %b, !dbg !119 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !121 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %a, %b, !dbg !120 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !122 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCallCompareGeneric.Main(i16 %a, i16 %b) #0 !dbg !123 { +// CHECK:STDOUT: define i1 @_CCallCompareGeneric.Main(i16 %a, i16 %b) #0 !dbg !124 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.04aebd1c4efdc136(i16 %a, i16 %b), !dbg !132 -// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !133 +// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.04aebd1c4efdc136(i16 %a, i16 %b), !dbg !133 +// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !134 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.04aebd1c4efdc136(i16 %x, i16 %y) #0 !dbg !135 { +// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.04aebd1c4efdc136(i16 %x, i16 %y) #0 !dbg !136 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = icmp eq i16 %x, %y, !dbg !142 -// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !144 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = icmp eq i16 %x, %y, !dbg !143 +// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !145 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!109} -// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!110} +// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !47, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -500,34 +503,35 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !38 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !39 = !{!"omnipotent char", !38, i64 0} -// CHECK:STDOUT: !44 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !45 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !47 = !{!"int", !39, i64 0} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !47, i64 0} -// CHECK:STDOUT: !49 = !{!48, !47, i64 0} -// CHECK:STDOUT: !108 = !DIFile(filename: "compare.carbon", directory: "") -// CHECK:STDOUT: !109 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !108, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !110 = !{!9, !6, !6} -// CHECK:STDOUT: !111 = !DISubroutineType(types: !110) -// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "Compare", linkageName: "_CCompare.Main", scope: null, file: !108, line: 6, type: !111, spFlags: DISPFlagDefinition, unit: !109, retainedNodes: !122) -// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !6) -// CHECK:STDOUT: !114 = !DILocalVariable(arg: 2, scope: !112, type: !6) -// CHECK:STDOUT: !119 = !DILocation(line: 7, column: 10, scope: !112) -// CHECK:STDOUT: !121 = !DILocation(line: 7, column: 3, scope: !112) -// CHECK:STDOUT: !122 = !{!113, !114} -// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "CallCompareGeneric", linkageName: "_CCallCompareGeneric.Main", scope: null, file: !108, line: 14, type: !111, spFlags: DISPFlagDefinition, unit: !109, retainedNodes: !134) -// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !6) -// CHECK:STDOUT: !125 = !DILocalVariable(arg: 2, scope: !123, type: !6) -// CHECK:STDOUT: !132 = !DILocation(line: 15, column: 10, scope: !123) -// CHECK:STDOUT: !133 = !DILocation(line: 15, column: 3, scope: !123) -// CHECK:STDOUT: !134 = !{!124, !125} -// CHECK:STDOUT: !135 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.04aebd1c4efdc136", scope: null, file: !108, line: 10, type: !111, spFlags: DISPFlagDefinition, unit: !109, retainedNodes: !145) -// CHECK:STDOUT: !136 = !DILocalVariable(arg: 1, scope: !135, type: !6) -// CHECK:STDOUT: !137 = !DILocalVariable(arg: 2, scope: !135, type: !6) -// CHECK:STDOUT: !142 = !DILocation(line: 11, column: 10, scope: !135) -// CHECK:STDOUT: !144 = !DILocation(line: 11, column: 3, scope: !135) -// CHECK:STDOUT: !145 = !{!136, !137} +// CHECK:STDOUT: !44 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !48 = !{!"int", !39, i64 0} +// CHECK:STDOUT: !49 = !{!"__libc_errno", !48, i64 0} +// CHECK:STDOUT: !50 = !{!49, !48, i64 0} +// CHECK:STDOUT: !109 = !DIFile(filename: "compare.carbon", directory: "") +// CHECK:STDOUT: !110 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !109, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !111 = !{!9, !6, !6} +// CHECK:STDOUT: !112 = !DISubroutineType(types: !111) +// CHECK:STDOUT: !113 = distinct !DISubprogram(name: "Compare", linkageName: "_CCompare.Main", scope: null, file: !109, line: 6, type: !112, spFlags: DISPFlagDefinition, unit: !110, retainedNodes: !123) +// CHECK:STDOUT: !114 = !DILocalVariable(arg: 1, scope: !113, type: !6) +// CHECK:STDOUT: !115 = !DILocalVariable(arg: 2, scope: !113, type: !6) +// CHECK:STDOUT: !120 = !DILocation(line: 7, column: 10, scope: !113) +// CHECK:STDOUT: !122 = !DILocation(line: 7, column: 3, scope: !113) +// CHECK:STDOUT: !123 = !{!114, !115} +// CHECK:STDOUT: !124 = distinct !DISubprogram(name: "CallCompareGeneric", linkageName: "_CCallCompareGeneric.Main", scope: null, file: !109, line: 14, type: !112, spFlags: DISPFlagDefinition, unit: !110, retainedNodes: !135) +// CHECK:STDOUT: !125 = !DILocalVariable(arg: 1, scope: !124, type: !6) +// CHECK:STDOUT: !126 = !DILocalVariable(arg: 2, scope: !124, type: !6) +// CHECK:STDOUT: !133 = !DILocation(line: 15, column: 10, scope: !124) +// CHECK:STDOUT: !134 = !DILocation(line: 15, column: 3, scope: !124) +// CHECK:STDOUT: !135 = !{!125, !126} +// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.04aebd1c4efdc136", scope: null, file: !109, line: 10, type: !112, spFlags: DISPFlagDefinition, unit: !110, retainedNodes: !146) +// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !6) +// CHECK:STDOUT: !138 = !DILocalVariable(arg: 2, scope: !136, type: !6) +// CHECK:STDOUT: !143 = !DILocation(line: 11, column: 10, scope: !136) +// CHECK:STDOUT: !145 = !DILocation(line: 11, column: 3, scope: !136) +// CHECK:STDOUT: !146 = !{!137, !138} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'compare_class.carbon' @@ -536,15 +540,15 @@ 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 !156 { +// CHECK:STDOUT: define i1 @_CCompare.Main(i16 %a, ptr %b) #0 !dbg !157 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_15.1.temp = alloca i16, align 2, !dbg !164 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_15.1.temp), !dbg !164 -// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %b, ptr %.loc18_15.1.temp), !dbg !164 -// CHECK:STDOUT: %.loc18_15.5 = load i16, ptr %.loc18_15.1.temp, align 2, !dbg !164 -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %a, %.loc18_15.5, !dbg !163 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.loc18_15.1.temp), !dbg !164 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !165 +// CHECK:STDOUT: %.loc18_15.1.temp = alloca i16, align 2, !dbg !165 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_15.1.temp), !dbg !165 +// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %b, ptr %.loc18_15.1.temp), !dbg !165 +// CHECK:STDOUT: %.loc18_15.5 = load i16, ptr %.loc18_15.1.temp, align 2, !dbg !165 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %a, %.loc18_15.5, !dbg !164 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.loc18_15.1.temp), !dbg !165 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !166 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -552,43 +556,43 @@ 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 !296 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !297 // 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 %this.addr, align 8, !tbaa !296, !nonnull !298 -// CHECK:STDOUT: %call = call noundef signext i16 @_ZNK13ConvertToEnumcvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1) %1) +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !297, !nonnull !299 +// CHECK:STDOUT: %call = call noundef i16 @_ZNK13ConvertToEnumcvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !43 // 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 !167 { +// CHECK:STDOUT: define i1 @_CCompare2.Main(i32 %a, ptr %b) #0 !dbg !168 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %b), !dbg !175 -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i32 %a, %__carbon_thunk.call, !dbg !174 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !176 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %b), !dbg !176 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i32 %a, %__carbon_thunk.call, !dbg !175 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !177 // 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 !296 -// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !296, !nonnull !298 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !297 +// CHECK:STDOUT: %0 = load ptr, ptr %this.addr, align 8, !tbaa !297, !nonnull !299 // 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 !178 { +// CHECK:STDOUT: define i1 @_CCompare3.Main(i16 %a, ptr %b) #0 !dbg !179 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc26_15.1.temp = alloca i16, align 2, !dbg !186 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_15.1.temp), !dbg !186 -// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %b, ptr %.loc26_15.1.temp), !dbg !186 -// CHECK:STDOUT: %.loc26_15.5 = load i16, ptr %.loc26_15.1.temp, align 2, !dbg !186 -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %a, %.loc26_15.5, !dbg !185 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.loc26_15.1.temp), !dbg !186 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !187 +// CHECK:STDOUT: %.loc26_15.1.temp = alloca i16, align 2, !dbg !187 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_15.1.temp), !dbg !187 +// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %b, ptr %.loc26_15.1.temp), !dbg !187 +// CHECK:STDOUT: %.loc26_15.5 = load i16, ptr %.loc26_15.1.temp, align 2, !dbg !187 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %a, %.loc26_15.5, !dbg !186 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.loc26_15.1.temp), !dbg !187 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !188 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -596,134 +600,134 @@ 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 !300 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !301 // 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 %this.addr, align 8, !tbaa !300, !nonnull !298 -// CHECK:STDOUT: %call = call noundef signext i16 @_ZNK14ConvertToEnum2cvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1) %1) +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !301, !nonnull !299 +// CHECK:STDOUT: %call = call noundef i16 @_ZNK14ConvertToEnum2cvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !43 // 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 !189 { +// CHECK:STDOUT: define i1 @_CCallCompareGeneric.Main(i16 %a, ptr %b) #0 !dbg !190 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.9f771e4a50bafdbe(i16 %a, ptr %b), !dbg !198 -// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !199 +// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.9f771e4a50bafdbe(i16 %a, ptr %b), !dbg !199 +// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !200 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.289080fd154ab9ff.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !201 { +// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.289080fd154ab9ff.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !202 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !204 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !204 -// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !204 -// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !204 -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %self, %.8, !dbg !204 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.4.temp), !dbg !204 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !204 +// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !205 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !205 +// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !205 +// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !205 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %self, %.8, !dbg !205 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.4.temp), !dbg !205 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !205 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.289080fd154ab9ff.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !206 { +// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.289080fd154ab9ff.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !207 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !209 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !209 -// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !209 -// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !209 -// CHECK:STDOUT: %OrderedWith.WithSelf.NotEqual.call = icmp ne i16 %self, %.8, !dbg !209 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.4.temp), !dbg !209 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.NotEqual.call, !dbg !209 +// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !210 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !210 +// CHECK:STDOUT: call void @_ZNK13ConvertToEnumcvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !210 +// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !210 +// CHECK:STDOUT: %OrderedWith.WithSelf.NotEqual.call = icmp ne i16 %self, %.8, !dbg !210 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.4.temp), !dbg !210 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.NotEqual.call, !dbg !210 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCallCompareGeneric2.Main(i32 %a, ptr %b) #0 !dbg !211 { +// CHECK:STDOUT: define i1 @_CCallCompareGeneric2.Main(i32 %a, ptr %b) #0 !dbg !212 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.1619d5a761aa4053(i32 %a, ptr %b), !dbg !220 -// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !221 +// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.1619d5a761aa4053(i32 %a, ptr %b), !dbg !221 +// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !222 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.5bf19682558af6f0.Core:OrderedWith.Core"(i32 %self, ptr %other) #2 !dbg !223 { +// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.5bf19682558af6f0.Core:OrderedWith.Core"(i32 %self, ptr %other) #2 !dbg !224 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %other), !dbg !226 -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i32 %self, %__carbon_thunk.call, !dbg !226 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !226 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %other), !dbg !227 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i32 %self, %__carbon_thunk.call, !dbg !227 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !227 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.5bf19682558af6f0.Core:OrderedWith.Core"(i32 %self, ptr %other) #2 !dbg !228 { +// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.5bf19682558af6f0.Core:OrderedWith.Core"(i32 %self, ptr %other) #2 !dbg !229 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %other), !dbg !231 -// CHECK:STDOUT: %OrderedWith.WithSelf.NotEqual.call = icmp ne i32 %self, %__carbon_thunk.call, !dbg !231 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.NotEqual.call, !dbg !231 +// CHECK:STDOUT: %__carbon_thunk.call = call i32 @_ZNK13ConvertToEnumcv2E2Ev.carbon_thunk._(ptr %other), !dbg !232 +// CHECK:STDOUT: %OrderedWith.WithSelf.NotEqual.call = icmp ne i32 %self, %__carbon_thunk.call, !dbg !232 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.NotEqual.call, !dbg !232 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i1 @_CCallCompareGeneric3.Main(i16 %a, ptr %b) #0 !dbg !233 { +// CHECK:STDOUT: define i1 @_CCallCompareGeneric3.Main(i16 %a, ptr %b) #0 !dbg !234 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.f7138dbf4790e4b2(i16 %a, ptr %b), !dbg !242 -// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !243 +// CHECK:STDOUT: %CompareGeneric.call = call i1 @_CCompareGeneric.Main.f7138dbf4790e4b2(i16 %a, ptr %b), !dbg !243 +// CHECK:STDOUT: ret i1 %CompareGeneric.call, !dbg !244 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.c237d0a9ef4b3a29.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !245 { +// CHECK:STDOUT: define weak_odr i1 @"_CEqual:thunk:EqWith.c237d0a9ef4b3a29.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !246 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !248 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !248 -// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !248 -// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !248 -// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %self, %.8, !dbg !248 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.4.temp), !dbg !248 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !248 +// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !249 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !249 +// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !249 +// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !249 +// CHECK:STDOUT: %OrderedWith.WithSelf.Equal.call = icmp eq i16 %self, %.8, !dbg !249 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.4.temp), !dbg !249 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.Equal.call, !dbg !249 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.c237d0a9ef4b3a29.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !250 { +// CHECK:STDOUT: define weak_odr i1 @"_CNotEqual:thunk:EqWith.c237d0a9ef4b3a29.Core:OrderedWith.Core"(i16 %self, ptr %other) #2 !dbg !251 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !253 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !253 -// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !253 -// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !253 -// CHECK:STDOUT: %OrderedWith.WithSelf.NotEqual.call = icmp ne i16 %self, %.8, !dbg !253 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.4.temp), !dbg !253 -// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.NotEqual.call, !dbg !253 +// CHECK:STDOUT: %.4.temp = alloca i16, align 2, !dbg !254 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.4.temp), !dbg !254 +// CHECK:STDOUT: call void @_ZNK14ConvertToEnum2cvN1C1EEEv.carbon_thunk._(ptr %other, ptr %.4.temp), !dbg !254 +// CHECK:STDOUT: %.8 = load i16, ptr %.4.temp, align 2, !dbg !254 +// CHECK:STDOUT: %OrderedWith.WithSelf.NotEqual.call = icmp ne i16 %self, %.8, !dbg !254 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %.4.temp), !dbg !254 +// CHECK:STDOUT: ret i1 %OrderedWith.WithSelf.NotEqual.call, !dbg !254 // 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 @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %t) #0 !dbg !255 { -// CHECK:STDOUT: ret void, !dbg !260 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.dd9c146f84d40ff5(ptr %t) #0 !dbg !256 { +// CHECK:STDOUT: ret void, !dbg !261 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.9f771e4a50bafdbe(i16 %x, ptr %y) #0 !dbg !262 { +// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.9f771e4a50bafdbe(i16 %x, ptr %y) #0 !dbg !263 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.289080fd154ab9ff.Core:OrderedWith.Core"(i16 %x, ptr %y), !dbg !269 -// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !271 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.289080fd154ab9ff.Core:OrderedWith.Core"(i16 %x, ptr %y), !dbg !270 +// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !272 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.1619d5a761aa4053(i32 %x, ptr %y) #0 !dbg !273 { +// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.1619d5a761aa4053(i32 %x, ptr %y) #0 !dbg !274 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.5bf19682558af6f0.Core:OrderedWith.Core"(i32 %x, ptr %y), !dbg !280 -// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !282 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.5bf19682558af6f0.Core:OrderedWith.Core"(i32 %x, ptr %y), !dbg !281 +// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !283 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.f7138dbf4790e4b2(i16 %x, ptr %y) #0 !dbg !284 { +// CHECK:STDOUT: define linkonce_odr i1 @_CCompareGeneric.Main.f7138dbf4790e4b2(i16 %x, ptr %y) #0 !dbg !285 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.c237d0a9ef4b3a29.Core:OrderedWith.Core"(i16 %x, ptr %y), !dbg !291 -// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !293 +// CHECK:STDOUT: %EqWith.WithSelf.Equal.call = call i1 @"_CEqual:thunk:EqWith.c237d0a9ef4b3a29.Core:OrderedWith.Core"(i16 %x, ptr %y), !dbg !292 +// CHECK:STDOUT: ret i1 %EqWith.WithSelf.Equal.call, !dbg !294 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: declare noundef signext i16 @_ZNK13ConvertToEnumcvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1)) #4 +// CHECK:STDOUT: declare noundef i16 @_ZNK13ConvertToEnumcvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1)) #4 // CHECK:STDOUT: // CHECK:STDOUT: declare noundef i32 @_ZNK13ConvertToEnumcv2E2Ev(ptr noundef nonnull align 1 dereferenceable(1)) #4 // CHECK:STDOUT: -// CHECK:STDOUT: declare noundef signext i16 @_ZNK14ConvertToEnum2cvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1)) #4 +// CHECK:STDOUT: declare noundef i16 @_ZNK14ConvertToEnum2cvN1C1EEEv(ptr noundef nonnull align 1 dereferenceable(1)) #4 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 5, 4, 3, 2, 1, 0 } @@ -735,9 +739,9 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!147} -// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} +// CHECK:STDOUT: !llvm.dbg.cu = !{!148} +// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !47, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!50} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -752,113 +756,114 @@ fn CallCompareGeneric3(a: Cpp.C.E, b: Cpp.ConvertToEnum2) -> bool { // CHECK:STDOUT: !41 = !{!40, !40, i64 0} // CHECK:STDOUT: !42 = !{!"_ZTSN1C1EE", !39, i64 0} // CHECK:STDOUT: !43 = !{!42, !42, i64 0} -// CHECK:STDOUT: !44 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !45 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !47 = !{!"int", !39, i64 0} -// CHECK:STDOUT: !48 = !{!"__libc_errno", !47, i64 0} -// CHECK:STDOUT: !49 = !{!48, !47, i64 0} -// CHECK:STDOUT: !78 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) -// CHECK:STDOUT: !146 = !DIFile(filename: "compare_class.carbon", directory: "") -// CHECK:STDOUT: !147 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !146, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !148 = !{!9, !6, !9} -// CHECK:STDOUT: !149 = !DISubroutineType(types: !148) -// CHECK:STDOUT: !152 = !{!9, !78, !9} -// CHECK:STDOUT: !153 = !DISubroutineType(types: !152) -// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "Compare", linkageName: "_CCompare.Main", scope: null, file: !146, line: 17, type: !149, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !166) -// CHECK:STDOUT: !157 = !DILocalVariable(arg: 1, scope: !156, type: !6) -// CHECK:STDOUT: !158 = !DILocalVariable(arg: 2, scope: !156, type: !9) -// CHECK:STDOUT: !163 = !DILocation(line: 18, column: 10, scope: !156) -// CHECK:STDOUT: !164 = !DILocation(line: 18, column: 15, scope: !156) -// CHECK:STDOUT: !165 = !DILocation(line: 18, column: 3, scope: !156) -// CHECK:STDOUT: !166 = !{!157, !158} -// CHECK:STDOUT: !167 = distinct !DISubprogram(name: "Compare2", linkageName: "_CCompare2.Main", scope: null, file: !146, line: 21, type: !153, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !177) -// CHECK:STDOUT: !168 = !DILocalVariable(arg: 1, scope: !167, type: !78) -// CHECK:STDOUT: !169 = !DILocalVariable(arg: 2, scope: !167, type: !9) -// CHECK:STDOUT: !174 = !DILocation(line: 22, column: 10, scope: !167) -// CHECK:STDOUT: !175 = !DILocation(line: 22, column: 15, scope: !167) -// CHECK:STDOUT: !176 = !DILocation(line: 22, column: 3, scope: !167) -// CHECK:STDOUT: !177 = !{!168, !169} -// CHECK:STDOUT: !178 = distinct !DISubprogram(name: "Compare3", linkageName: "_CCompare3.Main", scope: null, file: !146, line: 25, type: !149, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !188) -// CHECK:STDOUT: !179 = !DILocalVariable(arg: 1, scope: !178, type: !6) -// CHECK:STDOUT: !180 = !DILocalVariable(arg: 2, scope: !178, type: !9) -// CHECK:STDOUT: !185 = !DILocation(line: 26, column: 10, scope: !178) -// CHECK:STDOUT: !186 = !DILocation(line: 26, column: 15, scope: !178) -// CHECK:STDOUT: !187 = !DILocation(line: 26, column: 3, scope: !178) -// CHECK:STDOUT: !188 = !{!179, !180} -// CHECK:STDOUT: !189 = distinct !DISubprogram(name: "CallCompareGeneric", linkageName: "_CCallCompareGeneric.Main", scope: null, file: !146, line: 35, type: !149, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !200) -// CHECK:STDOUT: !190 = !DILocalVariable(arg: 1, scope: !189, type: !6) -// CHECK:STDOUT: !191 = !DILocalVariable(arg: 2, scope: !189, type: !9) -// CHECK:STDOUT: !198 = !DILocation(line: 36, column: 10, scope: !189) -// CHECK:STDOUT: !199 = !DILocation(line: 36, column: 3, scope: !189) -// CHECK:STDOUT: !200 = !{!190, !191} -// CHECK:STDOUT: !201 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.289080fd154ab9ff.Core:OrderedWith.Core", scope: null, file: !146, type: !149, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !205) -// CHECK:STDOUT: !202 = !DILocalVariable(arg: 1, scope: !201, type: !6) -// CHECK:STDOUT: !203 = !DILocalVariable(arg: 2, scope: !201, type: !9) -// CHECK:STDOUT: !204 = !DILocation(line: 0, scope: !201) -// CHECK:STDOUT: !205 = !{!202, !203} -// CHECK:STDOUT: !206 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.289080fd154ab9ff.Core:OrderedWith.Core", scope: null, file: !146, type: !149, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !210) -// CHECK:STDOUT: !207 = !DILocalVariable(arg: 1, scope: !206, type: !6) -// CHECK:STDOUT: !208 = !DILocalVariable(arg: 2, scope: !206, type: !9) -// CHECK:STDOUT: !209 = !DILocation(line: 0, scope: !206) -// CHECK:STDOUT: !210 = !{!207, !208} -// CHECK:STDOUT: !211 = distinct !DISubprogram(name: "CallCompareGeneric2", linkageName: "_CCallCompareGeneric2.Main", scope: null, file: !146, line: 39, type: !153, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !222) -// CHECK:STDOUT: !212 = !DILocalVariable(arg: 1, scope: !211, type: !78) -// CHECK:STDOUT: !213 = !DILocalVariable(arg: 2, scope: !211, type: !9) -// CHECK:STDOUT: !220 = !DILocation(line: 40, column: 10, scope: !211) -// CHECK:STDOUT: !221 = !DILocation(line: 40, column: 3, scope: !211) -// CHECK:STDOUT: !222 = !{!212, !213} -// CHECK:STDOUT: !223 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.5bf19682558af6f0.Core:OrderedWith.Core", scope: null, file: !146, type: !153, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !227) -// CHECK:STDOUT: !224 = !DILocalVariable(arg: 1, scope: !223, type: !78) -// CHECK:STDOUT: !225 = !DILocalVariable(arg: 2, scope: !223, type: !9) -// CHECK:STDOUT: !226 = !DILocation(line: 0, scope: !223) -// CHECK:STDOUT: !227 = !{!224, !225} -// CHECK:STDOUT: !228 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.5bf19682558af6f0.Core:OrderedWith.Core", scope: null, file: !146, type: !153, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !232) -// CHECK:STDOUT: !229 = !DILocalVariable(arg: 1, scope: !228, type: !78) -// CHECK:STDOUT: !230 = !DILocalVariable(arg: 2, scope: !228, type: !9) -// CHECK:STDOUT: !231 = !DILocation(line: 0, scope: !228) -// CHECK:STDOUT: !232 = !{!229, !230} -// CHECK:STDOUT: !233 = distinct !DISubprogram(name: "CallCompareGeneric3", linkageName: "_CCallCompareGeneric3.Main", scope: null, file: !146, line: 43, type: !149, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !244) -// CHECK:STDOUT: !234 = !DILocalVariable(arg: 1, scope: !233, type: !6) -// CHECK:STDOUT: !235 = !DILocalVariable(arg: 2, scope: !233, type: !9) -// CHECK:STDOUT: !242 = !DILocation(line: 44, column: 10, scope: !233) -// CHECK:STDOUT: !243 = !DILocation(line: 44, column: 3, scope: !233) -// CHECK:STDOUT: !244 = !{!234, !235} -// CHECK:STDOUT: !245 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.c237d0a9ef4b3a29.Core:OrderedWith.Core", scope: null, file: !146, type: !149, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !249) -// CHECK:STDOUT: !246 = !DILocalVariable(arg: 1, scope: !245, type: !6) -// CHECK:STDOUT: !247 = !DILocalVariable(arg: 2, scope: !245, type: !9) -// CHECK:STDOUT: !248 = !DILocation(line: 0, scope: !245) -// CHECK:STDOUT: !249 = !{!246, !247} -// CHECK:STDOUT: !250 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.c237d0a9ef4b3a29.Core:OrderedWith.Core", scope: null, file: !146, type: !149, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !254) -// CHECK:STDOUT: !251 = !DILocalVariable(arg: 1, scope: !250, type: !6) -// CHECK:STDOUT: !252 = !DILocalVariable(arg: 2, scope: !250, type: !9) -// CHECK:STDOUT: !253 = !DILocation(line: 0, scope: !250) -// CHECK:STDOUT: !254 = !{!251, !252} -// CHECK:STDOUT: !255 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.dd9c146f84d40ff5", scope: null, file: !30, line: 36, type: !16, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !261) -// CHECK:STDOUT: !256 = !DILocalVariable(arg: 1, scope: !255, type: !6) -// CHECK:STDOUT: !260 = !DILocation(line: 36, column: 1, scope: !255) -// CHECK:STDOUT: !261 = !{!256} -// CHECK:STDOUT: !262 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.9f771e4a50bafdbe", scope: null, file: !146, line: 29, type: !149, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !272) -// CHECK:STDOUT: !263 = !DILocalVariable(arg: 1, scope: !262, type: !6) -// CHECK:STDOUT: !264 = !DILocalVariable(arg: 2, scope: !262, type: !9) -// CHECK:STDOUT: !269 = !DILocation(line: 30, column: 10, scope: !262) -// CHECK:STDOUT: !271 = !DILocation(line: 30, column: 3, scope: !262) -// CHECK:STDOUT: !272 = !{!263, !264} -// CHECK:STDOUT: !273 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.1619d5a761aa4053", scope: null, file: !146, line: 29, type: !153, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !283) -// CHECK:STDOUT: !274 = !DILocalVariable(arg: 1, scope: !273, type: !78) -// CHECK:STDOUT: !275 = !DILocalVariable(arg: 2, scope: !273, type: !9) -// CHECK:STDOUT: !280 = !DILocation(line: 30, column: 10, scope: !273) -// CHECK:STDOUT: !282 = !DILocation(line: 30, column: 3, scope: !273) -// CHECK:STDOUT: !283 = !{!274, !275} -// CHECK:STDOUT: !284 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.f7138dbf4790e4b2", scope: null, file: !146, line: 29, type: !149, spFlags: DISPFlagDefinition, unit: !147, retainedNodes: !294) -// CHECK:STDOUT: !285 = !DILocalVariable(arg: 1, scope: !284, type: !6) -// CHECK:STDOUT: !286 = !DILocalVariable(arg: 2, scope: !284, type: !9) -// CHECK:STDOUT: !291 = !DILocation(line: 30, column: 10, scope: !284) -// CHECK:STDOUT: !293 = !DILocation(line: 30, column: 3, scope: !284) -// CHECK:STDOUT: !294 = !{!285, !286} -// CHECK:STDOUT: !295 = !{!"p1 _ZTS13ConvertToEnum", !40, i64 0} -// CHECK:STDOUT: !296 = !{!295, !295, i64 0} -// CHECK:STDOUT: !298 = !{} -// CHECK:STDOUT: !299 = !{!"p1 _ZTS14ConvertToEnum2", !40, i64 0} -// CHECK:STDOUT: !300 = !{!299, !299, i64 0} +// CHECK:STDOUT: !44 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !48 = !{!"int", !39, i64 0} +// CHECK:STDOUT: !49 = !{!"__libc_errno", !48, i64 0} +// CHECK:STDOUT: !50 = !{!49, !48, i64 0} +// CHECK:STDOUT: !79 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_unsigned) +// CHECK:STDOUT: !147 = !DIFile(filename: "compare_class.carbon", directory: "") +// CHECK:STDOUT: !148 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !147, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !149 = !{!9, !6, !9} +// CHECK:STDOUT: !150 = !DISubroutineType(types: !149) +// CHECK:STDOUT: !153 = !{!9, !79, !9} +// CHECK:STDOUT: !154 = !DISubroutineType(types: !153) +// CHECK:STDOUT: !157 = distinct !DISubprogram(name: "Compare", linkageName: "_CCompare.Main", scope: null, file: !147, line: 17, type: !150, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !167) +// CHECK:STDOUT: !158 = !DILocalVariable(arg: 1, scope: !157, type: !6) +// CHECK:STDOUT: !159 = !DILocalVariable(arg: 2, scope: !157, type: !9) +// CHECK:STDOUT: !164 = !DILocation(line: 18, column: 10, scope: !157) +// CHECK:STDOUT: !165 = !DILocation(line: 18, column: 15, scope: !157) +// CHECK:STDOUT: !166 = !DILocation(line: 18, column: 3, scope: !157) +// CHECK:STDOUT: !167 = !{!158, !159} +// CHECK:STDOUT: !168 = distinct !DISubprogram(name: "Compare2", linkageName: "_CCompare2.Main", scope: null, file: !147, line: 21, type: !154, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !178) +// CHECK:STDOUT: !169 = !DILocalVariable(arg: 1, scope: !168, type: !79) +// CHECK:STDOUT: !170 = !DILocalVariable(arg: 2, scope: !168, type: !9) +// CHECK:STDOUT: !175 = !DILocation(line: 22, column: 10, scope: !168) +// CHECK:STDOUT: !176 = !DILocation(line: 22, column: 15, scope: !168) +// CHECK:STDOUT: !177 = !DILocation(line: 22, column: 3, scope: !168) +// CHECK:STDOUT: !178 = !{!169, !170} +// CHECK:STDOUT: !179 = distinct !DISubprogram(name: "Compare3", linkageName: "_CCompare3.Main", scope: null, file: !147, line: 25, type: !150, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !189) +// CHECK:STDOUT: !180 = !DILocalVariable(arg: 1, scope: !179, type: !6) +// CHECK:STDOUT: !181 = !DILocalVariable(arg: 2, scope: !179, type: !9) +// CHECK:STDOUT: !186 = !DILocation(line: 26, column: 10, scope: !179) +// CHECK:STDOUT: !187 = !DILocation(line: 26, column: 15, scope: !179) +// CHECK:STDOUT: !188 = !DILocation(line: 26, column: 3, scope: !179) +// CHECK:STDOUT: !189 = !{!180, !181} +// CHECK:STDOUT: !190 = distinct !DISubprogram(name: "CallCompareGeneric", linkageName: "_CCallCompareGeneric.Main", scope: null, file: !147, line: 35, type: !150, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !201) +// CHECK:STDOUT: !191 = !DILocalVariable(arg: 1, scope: !190, type: !6) +// CHECK:STDOUT: !192 = !DILocalVariable(arg: 2, scope: !190, type: !9) +// CHECK:STDOUT: !199 = !DILocation(line: 36, column: 10, scope: !190) +// CHECK:STDOUT: !200 = !DILocation(line: 36, column: 3, scope: !190) +// CHECK:STDOUT: !201 = !{!191, !192} +// CHECK:STDOUT: !202 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.289080fd154ab9ff.Core:OrderedWith.Core", scope: null, file: !147, type: !150, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !206) +// CHECK:STDOUT: !203 = !DILocalVariable(arg: 1, scope: !202, type: !6) +// CHECK:STDOUT: !204 = !DILocalVariable(arg: 2, scope: !202, type: !9) +// CHECK:STDOUT: !205 = !DILocation(line: 0, scope: !202) +// CHECK:STDOUT: !206 = !{!203, !204} +// CHECK:STDOUT: !207 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.289080fd154ab9ff.Core:OrderedWith.Core", scope: null, file: !147, type: !150, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !211) +// CHECK:STDOUT: !208 = !DILocalVariable(arg: 1, scope: !207, type: !6) +// CHECK:STDOUT: !209 = !DILocalVariable(arg: 2, scope: !207, type: !9) +// CHECK:STDOUT: !210 = !DILocation(line: 0, scope: !207) +// CHECK:STDOUT: !211 = !{!208, !209} +// CHECK:STDOUT: !212 = distinct !DISubprogram(name: "CallCompareGeneric2", linkageName: "_CCallCompareGeneric2.Main", scope: null, file: !147, line: 39, type: !154, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !223) +// CHECK:STDOUT: !213 = !DILocalVariable(arg: 1, scope: !212, type: !79) +// CHECK:STDOUT: !214 = !DILocalVariable(arg: 2, scope: !212, type: !9) +// CHECK:STDOUT: !221 = !DILocation(line: 40, column: 10, scope: !212) +// CHECK:STDOUT: !222 = !DILocation(line: 40, column: 3, scope: !212) +// CHECK:STDOUT: !223 = !{!213, !214} +// CHECK:STDOUT: !224 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.5bf19682558af6f0.Core:OrderedWith.Core", scope: null, file: !147, type: !154, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !228) +// CHECK:STDOUT: !225 = !DILocalVariable(arg: 1, scope: !224, type: !79) +// CHECK:STDOUT: !226 = !DILocalVariable(arg: 2, scope: !224, type: !9) +// CHECK:STDOUT: !227 = !DILocation(line: 0, scope: !224) +// CHECK:STDOUT: !228 = !{!225, !226} +// CHECK:STDOUT: !229 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.5bf19682558af6f0.Core:OrderedWith.Core", scope: null, file: !147, type: !154, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !233) +// CHECK:STDOUT: !230 = !DILocalVariable(arg: 1, scope: !229, type: !79) +// CHECK:STDOUT: !231 = !DILocalVariable(arg: 2, scope: !229, type: !9) +// CHECK:STDOUT: !232 = !DILocation(line: 0, scope: !229) +// CHECK:STDOUT: !233 = !{!230, !231} +// CHECK:STDOUT: !234 = distinct !DISubprogram(name: "CallCompareGeneric3", linkageName: "_CCallCompareGeneric3.Main", scope: null, file: !147, line: 43, type: !150, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !245) +// CHECK:STDOUT: !235 = !DILocalVariable(arg: 1, scope: !234, type: !6) +// CHECK:STDOUT: !236 = !DILocalVariable(arg: 2, scope: !234, type: !9) +// CHECK:STDOUT: !243 = !DILocation(line: 44, column: 10, scope: !234) +// CHECK:STDOUT: !244 = !DILocation(line: 44, column: 3, scope: !234) +// CHECK:STDOUT: !245 = !{!235, !236} +// CHECK:STDOUT: !246 = distinct !DISubprogram(name: "Equal", linkageName: "_CEqual:thunk:EqWith.c237d0a9ef4b3a29.Core:OrderedWith.Core", scope: null, file: !147, type: !150, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !250) +// CHECK:STDOUT: !247 = !DILocalVariable(arg: 1, scope: !246, type: !6) +// CHECK:STDOUT: !248 = !DILocalVariable(arg: 2, scope: !246, type: !9) +// CHECK:STDOUT: !249 = !DILocation(line: 0, scope: !246) +// CHECK:STDOUT: !250 = !{!247, !248} +// CHECK:STDOUT: !251 = distinct !DISubprogram(name: "NotEqual", linkageName: "_CNotEqual:thunk:EqWith.c237d0a9ef4b3a29.Core:OrderedWith.Core", scope: null, file: !147, type: !150, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !255) +// CHECK:STDOUT: !252 = !DILocalVariable(arg: 1, scope: !251, type: !6) +// CHECK:STDOUT: !253 = !DILocalVariable(arg: 2, scope: !251, type: !9) +// CHECK:STDOUT: !254 = !DILocation(line: 0, scope: !251) +// CHECK:STDOUT: !255 = !{!252, !253} +// CHECK:STDOUT: !256 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.dd9c146f84d40ff5", scope: null, file: !30, line: 36, type: !16, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !262) +// CHECK:STDOUT: !257 = !DILocalVariable(arg: 1, scope: !256, type: !6) +// CHECK:STDOUT: !261 = !DILocation(line: 36, column: 1, scope: !256) +// CHECK:STDOUT: !262 = !{!257} +// CHECK:STDOUT: !263 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.9f771e4a50bafdbe", scope: null, file: !147, line: 29, type: !150, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !273) +// CHECK:STDOUT: !264 = !DILocalVariable(arg: 1, scope: !263, type: !6) +// CHECK:STDOUT: !265 = !DILocalVariable(arg: 2, scope: !263, type: !9) +// CHECK:STDOUT: !270 = !DILocation(line: 30, column: 10, scope: !263) +// CHECK:STDOUT: !272 = !DILocation(line: 30, column: 3, scope: !263) +// CHECK:STDOUT: !273 = !{!264, !265} +// CHECK:STDOUT: !274 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.1619d5a761aa4053", scope: null, file: !147, line: 29, type: !154, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !284) +// CHECK:STDOUT: !275 = !DILocalVariable(arg: 1, scope: !274, type: !79) +// CHECK:STDOUT: !276 = !DILocalVariable(arg: 2, scope: !274, type: !9) +// CHECK:STDOUT: !281 = !DILocation(line: 30, column: 10, scope: !274) +// CHECK:STDOUT: !283 = !DILocation(line: 30, column: 3, scope: !274) +// CHECK:STDOUT: !284 = !{!275, !276} +// CHECK:STDOUT: !285 = distinct !DISubprogram(name: "CompareGeneric", linkageName: "_CCompareGeneric.Main.f7138dbf4790e4b2", scope: null, file: !147, line: 29, type: !150, spFlags: DISPFlagDefinition, unit: !148, retainedNodes: !295) +// CHECK:STDOUT: !286 = !DILocalVariable(arg: 1, scope: !285, type: !6) +// CHECK:STDOUT: !287 = !DILocalVariable(arg: 2, scope: !285, type: !9) +// CHECK:STDOUT: !292 = !DILocation(line: 30, column: 10, scope: !285) +// CHECK:STDOUT: !294 = !DILocation(line: 30, column: 3, scope: !285) +// CHECK:STDOUT: !295 = !{!286, !287} +// CHECK:STDOUT: !296 = !{!"p1 _ZTS13ConvertToEnum", !40, i64 0} +// CHECK:STDOUT: !297 = !{!296, !296, i64 0} +// CHECK:STDOUT: !299 = !{} +// CHECK:STDOUT: !300 = !{!"p1 _ZTS14ConvertToEnum2", !40, i64 0} +// CHECK:STDOUT: !301 = !{!300, !300, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/extern_c.carbon b/toolchain/lower/testdata/interop/cpp/extern_c.carbon index e01423b2698a..7104141a4140 100644 --- a/toolchain/lower/testdata/interop/cpp/extern_c.carbon +++ b/toolchain/lower/testdata/interop/cpp/extern_c.carbon @@ -121,8 +121,8 @@ fn MyF() { // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!32} +// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !28, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -133,14 +133,15 @@ fn MyF() { // CHECK:STDOUT: !22 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !18, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !19) // CHECK:STDOUT: !23 = !DILocation(line: 7, column: 3, scope: !22) // CHECK:STDOUT: !24 = !DILocation(line: 6, column: 1, scope: !22) -// CHECK:STDOUT: !25 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !26 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !27 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !31 = !{!"__libc_errno", !30, i64 0} -// CHECK:STDOUT: !32 = !{!31, !30, i64 0} +// CHECK:STDOUT: !25 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !26 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !27 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !28 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !29 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !30 = !{!"omnipotent char", !29, i64 0} +// CHECK:STDOUT: !31 = !{!"int", !30, i64 0} +// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} +// CHECK:STDOUT: !33 = !{!32, !31, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'extern_c_function_with_cpp_overload_set.carbon' @@ -149,11 +150,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 !38 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !39 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @foo(), !dbg !39 -// CHECK:STDOUT: call void @_Z3fooi(i32 5), !dbg !40 -// CHECK:STDOUT: ret void, !dbg !41 +// CHECK:STDOUT: call void @foo(), !dbg !40 +// CHECK:STDOUT: call void @_Z3fooi(i32 5), !dbg !41 +// CHECK:STDOUT: ret void, !dbg !42 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @foo() #1 @@ -163,28 +164,29 @@ fn MyF() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!34} -// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!32} +// CHECK:STDOUT: !llvm.dbg.cu = !{!35} +// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !28, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !20 = !{null} // CHECK:STDOUT: !21 = !DISubroutineType(types: !20) -// CHECK:STDOUT: !25 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !26 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !27 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !31 = !{!"__libc_errno", !30, i64 0} -// CHECK:STDOUT: !32 = !{!31, !30, i64 0} -// CHECK:STDOUT: !33 = !DIFile(filename: "extern_c_function_with_cpp_overload_set.carbon", directory: "") -// CHECK:STDOUT: !34 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !33, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !38 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !33, line: 9, type: !21, spFlags: DISPFlagDefinition, unit: !34) -// CHECK:STDOUT: !39 = !DILocation(line: 10, column: 3, scope: !38) -// CHECK:STDOUT: !40 = !DILocation(line: 11, column: 3, scope: !38) -// CHECK:STDOUT: !41 = !DILocation(line: 9, column: 1, scope: !38) +// CHECK:STDOUT: !25 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !26 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !27 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !28 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !29 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !30 = !{!"omnipotent char", !29, i64 0} +// CHECK:STDOUT: !31 = !{!"int", !30, i64 0} +// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} +// CHECK:STDOUT: !33 = !{!32, !31, i64 0} +// CHECK:STDOUT: !34 = !DIFile(filename: "extern_c_function_with_cpp_overload_set.carbon", directory: "") +// CHECK:STDOUT: !35 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !34, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !34, line: 9, type: !21, spFlags: DISPFlagDefinition, unit: !35) +// CHECK:STDOUT: !40 = !DILocation(line: 10, column: 3, scope: !39) +// CHECK:STDOUT: !41 = !DILocation(line: 11, column: 3, scope: !39) +// CHECK:STDOUT: !42 = !DILocation(line: 9, column: 1, scope: !39) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_extern_c_variable.carbon' @@ -195,36 +197,37 @@ fn MyF() { // CHECK:STDOUT: @foo_var = external global i32, align 4 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CMyF.Main() #0 !dbg !46 { +// CHECK:STDOUT: define i32 @_CMyF.Main() #0 !dbg !47 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7 = load i32, ptr @foo_var, align 4, !dbg !49 -// CHECK:STDOUT: ret i32 %.loc7, !dbg !50 +// CHECK:STDOUT: %.loc7 = load i32, ptr @foo_var, align 4, !dbg !50 +// CHECK:STDOUT: ret i32 %.loc7, !dbg !51 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!43} -// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!32} +// CHECK:STDOUT: !llvm.dbg.cu = !{!44} +// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !28, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !25 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !26 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !27 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !31 = !{!"__libc_errno", !30, i64 0} -// CHECK:STDOUT: !32 = !{!31, !30, i64 0} -// CHECK:STDOUT: !35 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !42 = !DIFile(filename: "import_extern_c_variable.carbon", directory: "") -// CHECK:STDOUT: !43 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !42, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !44 = !{!35} -// CHECK:STDOUT: !45 = !DISubroutineType(types: !44) -// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !42, line: 6, type: !45, spFlags: DISPFlagDefinition, unit: !43) -// CHECK:STDOUT: !49 = !DILocation(line: 7, column: 10, scope: !46) -// CHECK:STDOUT: !50 = !DILocation(line: 7, column: 3, scope: !46) +// CHECK:STDOUT: !25 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !26 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !27 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !28 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !29 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !30 = !{!"omnipotent char", !29, i64 0} +// CHECK:STDOUT: !31 = !{!"int", !30, i64 0} +// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} +// CHECK:STDOUT: !33 = !{!32, !31, i64 0} +// CHECK:STDOUT: !36 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !43 = !DIFile(filename: "import_extern_c_variable.carbon", directory: "") +// CHECK:STDOUT: !44 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !43, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !45 = !{!36} +// CHECK:STDOUT: !46 = !DISubroutineType(types: !45) +// CHECK:STDOUT: !47 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !43, line: 6, type: !46, spFlags: DISPFlagDefinition, unit: !44) +// CHECK:STDOUT: !50 = !DILocation(line: 7, column: 10, scope: !47) +// CHECK:STDOUT: !51 = !DILocation(line: 7, column: 3, scope: !47) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_extern_c_with_special_name.carbon' @@ -235,10 +238,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 !58 { +// CHECK:STDOUT: define void @_CMyF.Main(ptr sret({}) %return, ptr %a, ptr %b) #0 !dbg !59 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Zpl1XS_.carbon_thunk.__(ptr %a, ptr %b, ptr %return), !dbg !65 -// CHECK:STDOUT: ret void, !dbg !67 +// CHECK:STDOUT: call void @_Zpl1XS_.carbon_thunk.__(ptr %a, ptr %b, ptr %return), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !68 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -250,12 +253,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 !71 -// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !71 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !71 -// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !71 -// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !71 -// CHECK:STDOUT: %4 = load ptr, ptr %.addr1, align 8, !tbaa !71 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !72 +// CHECK:STDOUT: store ptr %1, ptr %.addr1, align 8, !tbaa !72 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !72 +// CHECK:STDOUT: %2 = load ptr, ptr %return.addr, align 8, !tbaa !72 +// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !72 +// CHECK:STDOUT: %4 = load ptr, ptr %.addr1, align 8, !tbaa !72 // CHECK:STDOUT: call void @_Zpl1XS_() // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -266,34 +269,35 @@ fn MyF() { // CHECK:STDOUT: attributes #1 = { alwaysinline 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" } // CHECK:STDOUT: attributes #2 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!52} -// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!32} +// CHECK:STDOUT: !llvm.dbg.cu = !{!53} +// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !28, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !25 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !26 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !27 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !31 = !{!"__libc_errno", !30, i64 0} -// CHECK:STDOUT: !32 = !{!31, !30, i64 0} -// CHECK:STDOUT: !51 = !DIFile(filename: "import_extern_c_with_special_name.carbon", directory: "") -// CHECK:STDOUT: !52 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !51, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !53 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !54 = !{!53, !53, !53} -// CHECK:STDOUT: !55 = !DISubroutineType(types: !54) -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !51, line: 6, type: !55, spFlags: DISPFlagDefinition, unit: !52, retainedNodes: !68) -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !53) -// CHECK:STDOUT: !60 = !DILocalVariable(arg: 2, scope: !58, type: !53) -// CHECK:STDOUT: !65 = !DILocation(line: 7, column: 10, scope: !58) -// CHECK:STDOUT: !67 = !DILocation(line: 7, column: 3, scope: !58) -// CHECK:STDOUT: !68 = !{!59, !60} -// CHECK:STDOUT: !69 = !{!"any pointer", !29, i64 0} -// CHECK:STDOUT: !70 = !{!"p1 _ZTS1X", !69, i64 0} -// CHECK:STDOUT: !71 = !{!70, !70, i64 0} +// CHECK:STDOUT: !25 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !26 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !27 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !28 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !29 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !30 = !{!"omnipotent char", !29, i64 0} +// CHECK:STDOUT: !31 = !{!"int", !30, i64 0} +// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} +// CHECK:STDOUT: !33 = !{!32, !31, i64 0} +// CHECK:STDOUT: !52 = !DIFile(filename: "import_extern_c_with_special_name.carbon", directory: "") +// CHECK:STDOUT: !53 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !52, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !54 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !55 = !{!54, !54, !54} +// CHECK:STDOUT: !56 = !DISubroutineType(types: !55) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !52, line: 6, type: !56, spFlags: DISPFlagDefinition, unit: !53, retainedNodes: !69) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !54) +// CHECK:STDOUT: !61 = !DILocalVariable(arg: 2, scope: !59, type: !54) +// CHECK:STDOUT: !66 = !DILocation(line: 7, column: 10, scope: !59) +// CHECK:STDOUT: !68 = !DILocation(line: 7, column: 3, scope: !59) +// CHECK:STDOUT: !69 = !{!60, !61} +// CHECK:STDOUT: !70 = !{!"any pointer", !30, i64 0} +// CHECK:STDOUT: !71 = !{!"p1 _ZTS1X", !70, i64 0} +// CHECK:STDOUT: !72 = !{!71, !71, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_extern_c_with_asm_label.carbon' @@ -302,10 +306,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 !75 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @bar(), !dbg !76 -// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: call void @bar(), !dbg !77 +// CHECK:STDOUT: ret void, !dbg !78 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @bar() #1 @@ -313,25 +317,26 @@ fn MyF() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!74} -// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!32} +// CHECK:STDOUT: !llvm.dbg.cu = !{!75} +// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !28, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !20 = !{null} // CHECK:STDOUT: !21 = !DISubroutineType(types: !20) -// CHECK:STDOUT: !25 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !26 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !27 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !31 = !{!"__libc_errno", !30, i64 0} -// CHECK:STDOUT: !32 = !{!31, !30, i64 0} -// CHECK:STDOUT: !73 = !DIFile(filename: "import_extern_c_with_asm_label.carbon", directory: "") -// CHECK:STDOUT: !74 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !73, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !73, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !74) -// CHECK:STDOUT: !76 = !DILocation(line: 7, column: 3, scope: !75) -// CHECK:STDOUT: !77 = !DILocation(line: 6, column: 1, scope: !75) +// CHECK:STDOUT: !25 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !26 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !27 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !28 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !29 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !30 = !{!"omnipotent char", !29, i64 0} +// CHECK:STDOUT: !31 = !{!"int", !30, i64 0} +// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} +// CHECK:STDOUT: !33 = !{!32, !31, i64 0} +// CHECK:STDOUT: !74 = !DIFile(filename: "import_extern_c_with_asm_label.carbon", directory: "") +// CHECK:STDOUT: !75 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !74, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !74, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !75) +// CHECK:STDOUT: !77 = !DILocation(line: 7, column: 3, scope: !76) +// CHECK:STDOUT: !78 = !DILocation(line: 6, column: 1, scope: !76) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/export/constructor.carbon b/toolchain/lower/testdata/interop/cpp/function/export/constructor.carbon index 98d6b03a1570..f32a9a0d086e 100644 --- a/toolchain/lower/testdata/interop/cpp/function/export/constructor.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/export/constructor.carbon @@ -105,8 +105,8 @@ void f() { // CHECK:STDOUT: attributes #6 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!6} -// CHECK:STDOUT: !llvm.module.flags = !{!39, !40, !41, !3, !4} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!43} +// CHECK:STDOUT: !llvm.module.flags = !{!39, !40, !41, !42, !3, !4} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!44} // CHECK:STDOUT: // CHECK:STDOUT: !3 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !4 = !{i32 2, !"Debug Info Version", i32 3} @@ -139,9 +139,10 @@ void f() { // CHECK:STDOUT: !36 = !{!35, !35, i64 0} // CHECK:STDOUT: !37 = !{!"int", !33, i64 0} // CHECK:STDOUT: !38 = !{!37, !37, i64 0} -// CHECK:STDOUT: !39 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !40 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !41 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !42 = !{!"__libc_errno", !37, i64 0} -// CHECK:STDOUT: !43 = !{!42, !37, i64 0} +// CHECK:STDOUT: !39 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !43 = !{!"__libc_errno", !37, i64 0} +// CHECK:STDOUT: !44 = !{!43, !37, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/export/default_values.carbon b/toolchain/lower/testdata/interop/cpp/function/export/default_values.carbon index 06e4627e47a6..264ddb6787ab 100644 --- a/toolchain/lower/testdata/interop/cpp/function/export/default_values.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/export/default_values.carbon @@ -156,8 +156,8 @@ void CallF() { // CHECK:STDOUT: attributes #3 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!40} -// CHECK:STDOUT: !llvm.module.flags = !{!53, !54, !55, !6, !7} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} +// CHECK:STDOUT: !llvm.module.flags = !{!53, !54, !55, !56, !6, !7} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!58} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -184,9 +184,10 @@ void CallF() { // CHECK:STDOUT: !50 = !DISubroutineType(types: !49) // CHECK:STDOUT: !51 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !39, type: !50, spFlags: DISPFlagDefinition, unit: !40) // CHECK:STDOUT: !52 = !DILocation(line: 0, scope: !51) -// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !56 = !{!"__libc_errno", !2, i64 0} -// CHECK:STDOUT: !57 = !{!56, !2, i64 0} +// CHECK:STDOUT: !53 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !54 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !55 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !56 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !57 = !{!"__libc_errno", !2, i64 0} +// CHECK:STDOUT: !58 = !{!57, !2, i64 0} // 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 b7cdb0bc0245..feba76b9eac2 100644 --- a/toolchain/lower/testdata/interop/cpp/function/export/function.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/export/function.carbon @@ -264,8 +264,8 @@ fn CallCallBase() { Cpp.CallBase(); } // CHECK:STDOUT: attributes #2 = { nounwind "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!41} -// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!72} +// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !71, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!73} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -306,11 +306,12 @@ fn CallCallBase() { Cpp.CallBase(); } // CHECK:STDOUT: !65 = !{!64, !64, i64 0} // CHECK:STDOUT: !66 = !{!"float", !61, i64 0} // CHECK:STDOUT: !67 = !{!66, !66, i64 0} -// CHECK:STDOUT: !68 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !69 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !70 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !71 = !{!"__libc_errno", !64, i64 0} -// CHECK:STDOUT: !72 = !{!71, !64, i64 0} +// CHECK:STDOUT: !68 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !69 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !70 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !71 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !72 = !{!"__libc_errno", !64, i64 0} +// CHECK:STDOUT: !73 = !{!72, !64, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'single_file.carbon' @@ -323,23 +324,23 @@ fn CallCallBase() { Cpp.CallBase(); } // CHECK:STDOUT: $_Z2G1v = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !75 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: ret void, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CF__carbon_thunk.Main() #1 !dbg !77 { +// CHECK:STDOUT: define linkonce_odr void @_CF__carbon_thunk.Main() #1 !dbg !78 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CF.Main(), !dbg !78 -// CHECK:STDOUT: ret void, !dbg !78 +// CHECK:STDOUT: call void @_CF.Main(), !dbg !79 +// CHECK:STDOUT: ret void, !dbg !79 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CH.Main() #0 !dbg !79 { +// CHECK:STDOUT: define void @_CH.Main() #0 !dbg !80 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z2G2v(), !dbg !80 -// CHECK:STDOUT: ret void, !dbg !81 +// CHECK:STDOUT: call void @_Z2G2v(), !dbg !81 +// CHECK:STDOUT: ret void, !dbg !82 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress uwtable @@ -368,9 +369,9 @@ fn CallCallBase() { Cpp.CallBase(); } // CHECK:STDOUT: attributes #2 = { inlinehint 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" } // CHECK:STDOUT: attributes #3 = { alwaysinline 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!74} -// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!72} +// CHECK:STDOUT: !llvm.dbg.cu = !{!75} +// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !71, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!73} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -379,20 +380,21 @@ fn CallCallBase() { Cpp.CallBase(); } // CHECK:STDOUT: !60 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !61 = !{!"omnipotent char", !60, i64 0} // CHECK:STDOUT: !64 = !{!"int", !61, i64 0} -// CHECK:STDOUT: !68 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !69 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !70 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !71 = !{!"__libc_errno", !64, i64 0} -// CHECK:STDOUT: !72 = !{!71, !64, i64 0} -// CHECK:STDOUT: !73 = !DIFile(filename: "single_file.carbon", directory: "") -// CHECK:STDOUT: !74 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !73, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !73, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !74) -// CHECK:STDOUT: !76 = !DILocation(line: 6, column: 1, scope: !75) -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Main", scope: null, file: !73, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !74) -// CHECK:STDOUT: !78 = !DILocation(line: 6, column: 1, scope: !77) -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !73, line: 20, type: !8, spFlags: DISPFlagDefinition, unit: !74) -// CHECK:STDOUT: !80 = !DILocation(line: 20, column: 10, scope: !79) -// CHECK:STDOUT: !81 = !DILocation(line: 20, column: 1, scope: !79) +// CHECK:STDOUT: !68 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !69 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !70 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !71 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !72 = !{!"__libc_errno", !64, i64 0} +// CHECK:STDOUT: !73 = !{!72, !64, i64 0} +// CHECK:STDOUT: !74 = !DIFile(filename: "single_file.carbon", directory: "") +// CHECK:STDOUT: !75 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !74, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !74, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !75) +// CHECK:STDOUT: !77 = !DILocation(line: 6, column: 1, scope: !76) +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Main", scope: null, file: !74, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !75) +// CHECK:STDOUT: !79 = !DILocation(line: 6, column: 1, scope: !78) +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !74, line: 20, type: !8, spFlags: DISPFlagDefinition, unit: !75) +// CHECK:STDOUT: !81 = !DILocation(line: 20, column: 10, scope: !80) +// CHECK:STDOUT: !82 = !DILocation(line: 20, column: 1, scope: !80) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'keyword_name.carbon' @@ -403,23 +405,23 @@ fn CallCallBase() { Cpp.CallBase(); } // CHECK:STDOUT: $_Z8CallBasev = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_Cbase.Main() #0 !dbg !84 { +// CHECK:STDOUT: define void @_Cbase.Main() #0 !dbg !85 { // 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 linkonce_odr void @_Cbase__carbon_thunk.Main() #1 !dbg !86 { +// CHECK:STDOUT: define linkonce_odr void @_Cbase__carbon_thunk.Main() #1 !dbg !87 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Cbase.Main(), !dbg !87 -// CHECK:STDOUT: ret void, !dbg !87 +// CHECK:STDOUT: call void @_Cbase.Main(), !dbg !88 +// CHECK:STDOUT: ret void, !dbg !88 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CCallCallBase.Main() #0 !dbg !88 { +// CHECK:STDOUT: define void @_CCallCallBase.Main() #0 !dbg !89 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z8CallBasev(), !dbg !89 -// CHECK:STDOUT: ret void, !dbg !90 +// CHECK:STDOUT: call void @_Z8CallBasev(), !dbg !90 +// CHECK:STDOUT: ret void, !dbg !91 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress uwtable @@ -441,9 +443,9 @@ fn CallCallBase() { Cpp.CallBase(); } // CHECK:STDOUT: attributes #2 = { inlinehint 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" } // CHECK:STDOUT: attributes #3 = { alwaysinline 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!83} -// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!72} +// CHECK:STDOUT: !llvm.dbg.cu = !{!84} +// CHECK:STDOUT: !llvm.module.flags = !{!68, !69, !70, !71, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!73} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -452,18 +454,19 @@ fn CallCallBase() { Cpp.CallBase(); } // CHECK:STDOUT: !60 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !61 = !{!"omnipotent char", !60, i64 0} // CHECK:STDOUT: !64 = !{!"int", !61, i64 0} -// CHECK:STDOUT: !68 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !69 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !70 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !71 = !{!"__libc_errno", !64, i64 0} -// CHECK:STDOUT: !72 = !{!71, !64, i64 0} -// CHECK:STDOUT: !82 = !DIFile(filename: "keyword_name.carbon", directory: "") -// CHECK:STDOUT: !83 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !82, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "base", linkageName: "_Cbase.Main", scope: null, file: !82, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !83) -// CHECK:STDOUT: !85 = !DILocation(line: 6, column: 1, scope: !84) -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "base__carbon_thunk", linkageName: "_Cbase__carbon_thunk.Main", scope: null, file: !82, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !83) -// CHECK:STDOUT: !87 = !DILocation(line: 6, column: 1, scope: !86) -// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "CallCallBase", linkageName: "_CCallCallBase.Main", scope: null, file: !82, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !83) -// CHECK:STDOUT: !89 = !DILocation(line: 14, column: 21, scope: !88) -// CHECK:STDOUT: !90 = !DILocation(line: 14, column: 1, scope: !88) +// CHECK:STDOUT: !68 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !69 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !70 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !71 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !72 = !{!"__libc_errno", !64, i64 0} +// CHECK:STDOUT: !73 = !{!72, !64, i64 0} +// CHECK:STDOUT: !83 = !DIFile(filename: "keyword_name.carbon", directory: "") +// CHECK:STDOUT: !84 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !83, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "base", linkageName: "_Cbase.Main", scope: null, file: !83, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !84) +// CHECK:STDOUT: !86 = !DILocation(line: 6, column: 1, scope: !85) +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "base__carbon_thunk", linkageName: "_Cbase__carbon_thunk.Main", scope: null, file: !83, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !84) +// CHECK:STDOUT: !88 = !DILocation(line: 6, column: 1, scope: !87) +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "CallCallBase", linkageName: "_CCallCallBase.Main", scope: null, file: !83, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !84) +// CHECK:STDOUT: !90 = !DILocation(line: 14, column: 21, scope: !89) +// CHECK:STDOUT: !91 = !DILocation(line: 14, column: 1, scope: !89) // 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 990d978a6636..930abcc9b81f 100644 --- a/toolchain/lower/testdata/interop/cpp/function/export/generic.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/export/generic.carbon @@ -255,8 +255,8 @@ fn Run() { // CHECK:STDOUT: attributes #6 = { nounwind "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!15} -// CHECK:STDOUT: !llvm.module.flags = !{!86, !87, !88, !4, !5} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!91} +// CHECK:STDOUT: !llvm.module.flags = !{!86, !87, !88, !89, !4, !5} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!92} // CHECK:STDOUT: // CHECK:STDOUT: !4 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !5 = !{i32 2, !"Debug Info Version", i32 3} @@ -321,10 +321,11 @@ fn Run() { // CHECK:STDOUT: !83 = !{!82, !82, i64 0} // CHECK:STDOUT: !84 = !{!"p1 _ZTSN6Carbon4Main1BE", !81, i64 0} // CHECK:STDOUT: !85 = !{!84, !84, i64 0} -// CHECK:STDOUT: !86 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !87 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !88 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !89 = !{!"int", !80, i64 0} -// CHECK:STDOUT: !90 = !{!"__libc_errno", !89, i64 0} -// CHECK:STDOUT: !91 = !{!90, !89, i64 0} +// CHECK:STDOUT: !86 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !87 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !88 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !89 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !90 = !{!"int", !80, i64 0} +// CHECK:STDOUT: !91 = !{!"__libc_errno", !90, i64 0} +// CHECK:STDOUT: !92 = !{!91, !90, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/export/macho_asm_label.carbon b/toolchain/lower/testdata/interop/cpp/function/export/macho_asm_label.carbon index e77b1cad80a3..e0262d1995ec 100644 --- a/toolchain/lower/testdata/interop/cpp/function/export/macho_asm_label.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/export/macho_asm_label.carbon @@ -105,8 +105,8 @@ fn H() -> i32 { return Cpp.G(); } // CHECK:STDOUT: attributes #3 = { nounwind "frame-pointer"="non-leaf-no-reserve" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+altnzcv,+ccdp,+ccidx,+ccpp,+complxnum,+crc,+dit,+dotprod,+flagm,+fp-armv8,+fp16fml,+fptoint,+fullfp16,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+sha3,+specrestrict,+ssbs,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8a" "tune-cpu"="apple-m5" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!10} -// CHECK:STDOUT: !llvm.module.flags = !{!37, !38, !39, !7, !8} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!41} +// CHECK:STDOUT: !llvm.module.flags = !{!37, !38, !39, !40, !7, !8} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!42} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -135,11 +135,12 @@ fn H() -> i32 { return Cpp.G(); } // CHECK:STDOUT: !34 = !DILocation(line: 14, column: 24, scope: !31) // CHECK:STDOUT: !35 = !DILocation(line: 14, column: 17, scope: !31) // CHECK:STDOUT: !36 = !{!2, !2, i64 0} -// CHECK:STDOUT: !37 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !38 = !{i32 7, !"uwtable", i32 1} -// CHECK:STDOUT: !39 = !{i32 7, !"frame-pointer", i32 4} -// CHECK:STDOUT: !40 = !{!"__libc_errno", !2, i64 0} -// CHECK:STDOUT: !41 = !{!40, !2, i64 0} +// CHECK:STDOUT: !37 = !{i32 2, !"debugger-tuning", !"lldb"} +// CHECK:STDOUT: !38 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !39 = !{i32 7, !"uwtable", i32 1} +// CHECK:STDOUT: !40 = !{i32 7, !"frame-pointer", i32 4} +// CHECK:STDOUT: !41 = !{!"__libc_errno", !2, i64 0} +// CHECK:STDOUT: !42 = !{!41, !2, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'constructor.carbon' @@ -170,7 +171,7 @@ fn H() -> i32 { return Cpp.G(); } // 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 !101 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !102 // CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !36 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %call = call noundef ptr @"\01__CC__carbon_thunk.C.Main"(ptr noundef nonnull align 4 dereferenceable(4) %this1, ptr noundef nonnull align 4 dereferenceable(4) %.addr) @@ -181,7 +182,7 @@ fn H() -> i32 { return Cpp.G(); } // CHECK:STDOUT: define linkonce_odr noundef ptr @_ZN6Carbon4Main1CD1Ev(ptr noundef nonnull returned align 4 dead_on_return(4) dereferenceable(4) %this) unnamed_addr #3 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !101 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !102 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: %call = call noundef ptr @_ZN6Carbon4Main1CD2Ev(ptr noundef nonnull align 4 dead_on_return(4) dereferenceable(4) %this1) #4 // CHECK:STDOUT: ret ptr %this1 @@ -191,67 +192,67 @@ fn H() -> i32 { return Cpp.G(); } // CHECK:STDOUT: declare void @llvm.lifetime.end.p0(ptr captures(none)) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CC.C.Main(ptr sret({ i32 }) %return, i32 %i) #4 !dbg !51 { +// CHECK:STDOUT: define void @_CC.C.Main(ptr sret({ i32 }) %return, i32 %i) #4 !dbg !52 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc8_19.2.i = getelementptr inbounds nuw { i32 }, ptr %return, i32 0, i32 0, !dbg !57 -// CHECK:STDOUT: store i32 %i, ptr %.loc8_19.2.i, align 4, !dbg !57 -// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: %.loc8_19.2.i = getelementptr inbounds nuw { i32 }, ptr %return, i32 0, i32 0, !dbg !58 +// CHECK:STDOUT: store i32 %i, ptr %.loc8_19.2.i, align 4, !dbg !58 +// CHECK:STDOUT: ret void, !dbg !59 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #5 !dbg !60 { +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #5 !dbg !61 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CSelfDestruct.Core.356af3b6aef18564(ptr %self), !dbg !62 -// CHECK:STDOUT: ret void, !dbg !62 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.356af3b6aef18564(ptr %self), !dbg !63 +// CHECK:STDOUT: ret void, !dbg !63 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.d424893893628d5b:core.SubobjectDestroy.Core"(ptr %self) #4 !dbg !64 { +// CHECK:STDOUT: define weak_odr void @"_COp.d424893893628d5b:core.SubobjectDestroy.Core"(ptr %self) #4 !dbg !65 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_9.1.i = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !66 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_9.1.i), !dbg !66 -// CHECK:STDOUT: ret void, !dbg !66 +// CHECK:STDOUT: %.loc6_9.1.i = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !67 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_9.1.i), !dbg !67 +// CHECK:STDOUT: ret void, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.SubobjectDestroy.Core"(ptr %self) #4 !dbg !70 { +// CHECK:STDOUT: define weak_odr void @"_COp.08d9e38b928ba575:core.SubobjectDestroy.Core"(ptr %self) #4 !dbg !71 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc6_9.1.i = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !72 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_9.1.i), !dbg !72 -// CHECK:STDOUT: ret void, !dbg !72 +// CHECK:STDOUT: %.loc6_9.1.i = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !73 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc6_9.1.i), !dbg !73 +// CHECK:STDOUT: ret void, !dbg !73 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr noundef ptr @"\01__CC__carbon_thunk.C.Main"(ptr noundef nonnull returned align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) unnamed_addr #6 !dbg !74 { +// CHECK:STDOUT: define linkonce_odr noundef ptr @"\01__CC__carbon_thunk.C.Main"(ptr noundef nonnull returned align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) unnamed_addr #6 !dbg !75 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7_24.2 = load i32, ptr %_1, align 4, !dbg !77 -// CHECK:STDOUT: call void @_CC.C.Main(ptr %_, i32 %.loc7_24.2), !dbg !77 +// CHECK:STDOUT: %.loc7_24.2 = load i32, ptr %_1, align 4, !dbg !78 +// CHECK:STDOUT: call void @_CC.C.Main(ptr %_, i32 %.loc7_24.2), !dbg !78 // CHECK:STDOUT: ret ptr %_ // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CH.Main() #4 !dbg !79 { +// CHECK:STDOUT: define i32 @_CH.Main() #4 !dbg !80 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %G.call = call i32 @_Z1Gv(), !dbg !82 -// CHECK:STDOUT: ret i32 %G.call, !dbg !83 +// CHECK:STDOUT: %G.call = call i32 @_Z1Gv(), !dbg !83 +// CHECK:STDOUT: ret i32 %G.call, !dbg !84 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.356af3b6aef18564(ptr %t) #4 !dbg !85 { -// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.SubobjectDestroy.Core"(ptr %t), !dbg !89 -// CHECK:STDOUT: ret void, !dbg !90 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.356af3b6aef18564(ptr %t) #4 !dbg !86 { +// CHECK:STDOUT: call void @"_COp.08d9e38b928ba575:core.SubobjectDestroy.Core"(ptr %t), !dbg !90 +// CHECK:STDOUT: ret void, !dbg !91 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #4 !dbg !92 { -// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #4 !dbg !93 { +// CHECK:STDOUT: ret void, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind ssp uwtable(sync) // CHECK:STDOUT: define linkonce_odr noundef ptr @_ZN6Carbon4Main1CD2Ev(ptr noundef nonnull returned align 4 dead_on_return(4) dereferenceable(4) %this) unnamed_addr #3 personality ptr @__gxx_personality_v0 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %this.addr = alloca ptr, align 8 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !101 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !102 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: invoke void @"\01__C__destroy_thunk:thunk.C.Main"(ptr noundef nonnull align 4 dereferenceable(4) %this1) // CHECK:STDOUT: to label %invoke.cont unwind label %terminate.lpad @@ -296,9 +297,9 @@ fn H() -> i32 { return Cpp.G(); } // CHECK:STDOUT: attributes #8 = { noinline noreturn nounwind ssp uwtable(sync) "frame-pointer"="non-leaf-no-reserve" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+altnzcv,+ccdp,+ccidx,+ccpp,+complxnum,+crc,+dit,+dotprod,+flagm,+fp-armv8,+fp16fml,+fptoint,+fullfp16,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+sha3,+specrestrict,+ssbs,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8a" "tune-cpu"="apple-m5" } // CHECK:STDOUT: attributes #9 = { noreturn nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!43} -// CHECK:STDOUT: !llvm.module.flags = !{!37, !38, !39, !7, !8} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!41} +// CHECK:STDOUT: !llvm.dbg.cu = !{!44} +// CHECK:STDOUT: !llvm.module.flags = !{!37, !38, !39, !40, !7, !8} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!42} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -311,58 +312,59 @@ fn H() -> i32 { return Cpp.G(); } // CHECK:STDOUT: !16 = !{!11} // CHECK:STDOUT: !17 = !DISubroutineType(types: !16) // CHECK:STDOUT: !36 = !{!2, !2, i64 0} -// CHECK:STDOUT: !37 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !38 = !{i32 7, !"uwtable", i32 1} -// CHECK:STDOUT: !39 = !{i32 7, !"frame-pointer", i32 4} -// CHECK:STDOUT: !40 = !{!"__libc_errno", !2, i64 0} -// CHECK:STDOUT: !41 = !{!40, !2, i64 0} -// CHECK:STDOUT: !42 = !DIFile(filename: "constructor.carbon", directory: "") -// CHECK:STDOUT: !43 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !42, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !44 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !45 = !{!44, !11} -// CHECK:STDOUT: !46 = !DISubroutineType(types: !45) -// CHECK:STDOUT: !47 = !{null, !44} -// CHECK:STDOUT: !48 = !DISubroutineType(types: !47) -// CHECK:STDOUT: !49 = !{null, !44, !11} -// CHECK:STDOUT: !50 = !DISubroutineType(types: !49) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "C", linkageName: "_CC.C.Main", scope: null, file: !42, line: 7, type: !46, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !59) -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !11) -// CHECK:STDOUT: !57 = !DILocation(line: 8, column: 12, scope: !51) -// CHECK:STDOUT: !58 = !DILocation(line: 8, column: 5, scope: !51) -// CHECK:STDOUT: !59 = !{!52} -// CHECK:STDOUT: !60 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !42, line: 6, type: !48, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !63) -// CHECK:STDOUT: !61 = !DILocalVariable(arg: 1, scope: !60, type: !44) -// CHECK:STDOUT: !62 = !DILocation(line: 6, column: 1, scope: !60) -// CHECK:STDOUT: !63 = !{!61} -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d424893893628d5b:core.SubobjectDestroy.Core", scope: null, file: !42, line: 6, type: !48, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !69) -// CHECK:STDOUT: !65 = !DILocalVariable(arg: 1, scope: !64, type: !44) -// CHECK:STDOUT: !66 = !DILocation(line: 6, column: 1, scope: !64) -// CHECK:STDOUT: !67 = !{null, !11} -// CHECK:STDOUT: !68 = !DISubroutineType(types: !67) -// CHECK:STDOUT: !69 = !{!65} -// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.SubobjectDestroy.Core", scope: null, file: !42, line: 6, type: !48, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !73) -// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !44) -// CHECK:STDOUT: !72 = !DILocation(line: 6, column: 1, scope: !70) -// CHECK:STDOUT: !73 = !{!71} -// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "C__carbon_thunk", linkageName: "_CC__carbon_thunk.C.Main", scope: null, file: !42, line: 7, type: !50, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !78) -// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !44) -// CHECK:STDOUT: !76 = !DILocalVariable(arg: 2, scope: !74, type: !11) -// CHECK:STDOUT: !77 = !DILocation(line: 7, column: 3, scope: !74) -// CHECK:STDOUT: !78 = !{!75, !76} -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !42, line: 21, type: !17, spFlags: DISPFlagDefinition, unit: !43) -// CHECK:STDOUT: !82 = !DILocation(line: 21, column: 24, scope: !79) -// CHECK:STDOUT: !83 = !DILocation(line: 21, column: 17, scope: !79) -// CHECK:STDOUT: !84 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.356af3b6aef18564", scope: null, file: !84, line: 36, type: !48, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !91) -// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !44) -// CHECK:STDOUT: !89 = !DILocation(line: 38, column: 5, scope: !85) -// CHECK:STDOUT: !90 = !DILocation(line: 36, column: 1, scope: !85) -// CHECK:STDOUT: !91 = !{!86} -// CHECK:STDOUT: !92 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !84, line: 36, type: !68, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !98) -// CHECK:STDOUT: !93 = !DILocalVariable(arg: 1, scope: !92, type: !11) -// CHECK:STDOUT: !97 = !DILocation(line: 36, column: 1, scope: !92) -// CHECK:STDOUT: !98 = !{!93} -// CHECK:STDOUT: !99 = !{!"any pointer", !1, i64 0} -// CHECK:STDOUT: !100 = !{!"p1 _ZTSN6Carbon4Main1CE", !99, i64 0} -// CHECK:STDOUT: !101 = !{!100, !100, i64 0} +// CHECK:STDOUT: !37 = !{i32 2, !"debugger-tuning", !"lldb"} +// CHECK:STDOUT: !38 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !39 = !{i32 7, !"uwtable", i32 1} +// CHECK:STDOUT: !40 = !{i32 7, !"frame-pointer", i32 4} +// CHECK:STDOUT: !41 = !{!"__libc_errno", !2, i64 0} +// CHECK:STDOUT: !42 = !{!41, !2, i64 0} +// CHECK:STDOUT: !43 = !DIFile(filename: "constructor.carbon", directory: "") +// CHECK:STDOUT: !44 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !43, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !46 = !{!45, !11} +// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) +// CHECK:STDOUT: !48 = !{null, !45} +// CHECK:STDOUT: !49 = !DISubroutineType(types: !48) +// CHECK:STDOUT: !50 = !{null, !45, !11} +// CHECK:STDOUT: !51 = !DISubroutineType(types: !50) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "C", linkageName: "_CC.C.Main", scope: null, file: !43, line: 7, type: !47, spFlags: DISPFlagDefinition, unit: !44, retainedNodes: !60) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !11) +// CHECK:STDOUT: !58 = !DILocation(line: 8, column: 12, scope: !52) +// CHECK:STDOUT: !59 = !DILocation(line: 8, column: 5, scope: !52) +// CHECK:STDOUT: !60 = !{!53} +// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !43, line: 6, type: !49, spFlags: DISPFlagDefinition, unit: !44, retainedNodes: !64) +// CHECK:STDOUT: !62 = !DILocalVariable(arg: 1, scope: !61, type: !45) +// CHECK:STDOUT: !63 = !DILocation(line: 6, column: 1, scope: !61) +// CHECK:STDOUT: !64 = !{!62} +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "Op", linkageName: "_COp.d424893893628d5b:core.SubobjectDestroy.Core", scope: null, file: !43, line: 6, type: !49, spFlags: DISPFlagDefinition, unit: !44, retainedNodes: !70) +// CHECK:STDOUT: !66 = !DILocalVariable(arg: 1, scope: !65, type: !45) +// CHECK:STDOUT: !67 = !DILocation(line: 6, column: 1, scope: !65) +// CHECK:STDOUT: !68 = !{null, !11} +// CHECK:STDOUT: !69 = !DISubroutineType(types: !68) +// CHECK:STDOUT: !70 = !{!66} +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "Op", linkageName: "_COp.08d9e38b928ba575:core.SubobjectDestroy.Core", scope: null, file: !43, line: 6, type: !49, spFlags: DISPFlagDefinition, unit: !44, retainedNodes: !74) +// CHECK:STDOUT: !72 = !DILocalVariable(arg: 1, scope: !71, type: !45) +// CHECK:STDOUT: !73 = !DILocation(line: 6, column: 1, scope: !71) +// CHECK:STDOUT: !74 = !{!72} +// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "C__carbon_thunk", linkageName: "_CC__carbon_thunk.C.Main", scope: null, file: !43, line: 7, type: !51, spFlags: DISPFlagDefinition, unit: !44, retainedNodes: !79) +// CHECK:STDOUT: !76 = !DILocalVariable(arg: 1, scope: !75, type: !45) +// CHECK:STDOUT: !77 = !DILocalVariable(arg: 2, scope: !75, type: !11) +// CHECK:STDOUT: !78 = !DILocation(line: 7, column: 3, scope: !75) +// CHECK:STDOUT: !79 = !{!76, !77} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !43, line: 21, type: !17, spFlags: DISPFlagDefinition, unit: !44) +// CHECK:STDOUT: !83 = !DILocation(line: 21, column: 24, scope: !80) +// CHECK:STDOUT: !84 = !DILocation(line: 21, column: 17, scope: !80) +// CHECK:STDOUT: !85 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.356af3b6aef18564", scope: null, file: !85, line: 36, type: !49, spFlags: DISPFlagDefinition, unit: !44, retainedNodes: !92) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !45) +// CHECK:STDOUT: !90 = !DILocation(line: 38, column: 5, scope: !86) +// CHECK:STDOUT: !91 = !DILocation(line: 36, column: 1, scope: !86) +// CHECK:STDOUT: !92 = !{!87} +// CHECK:STDOUT: !93 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !85, line: 36, type: !69, spFlags: DISPFlagDefinition, unit: !44, retainedNodes: !99) +// CHECK:STDOUT: !94 = !DILocalVariable(arg: 1, scope: !93, type: !11) +// CHECK:STDOUT: !98 = !DILocation(line: 36, column: 1, scope: !93) +// CHECK:STDOUT: !99 = !{!94} +// CHECK:STDOUT: !100 = !{!"any pointer", !1, i64 0} +// CHECK:STDOUT: !101 = !{!"p1 _ZTSN6Carbon4Main1CE", !100, i64 0} +// CHECK:STDOUT: !102 = !{!101, !101, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/export/multiple_files.carbon b/toolchain/lower/testdata/interop/cpp/function/export/multiple_files.carbon index 6d2a3cb75622..2d39b22511d9 100644 --- a/toolchain/lower/testdata/interop/cpp/function/export/multiple_files.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/export/multiple_files.carbon @@ -107,8 +107,8 @@ int UseB() { return Carbon::Other::Identity(4); } // CHECK:STDOUT: attributes #2 = { nounwind "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!32} -// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} +// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !47, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -127,11 +127,12 @@ int UseB() { return Carbon::Other::Identity(4); } // CHECK:STDOUT: !41 = !{!"omnipotent char", !40, i64 0} // CHECK:STDOUT: !42 = !{!"int", !41, i64 0} // CHECK:STDOUT: !43 = !{!42, !42, i64 0} -// CHECK:STDOUT: !44 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !45 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !47 = !{!"__libc_errno", !42, i64 0} -// CHECK:STDOUT: !48 = !{!47, !42, i64 0} +// CHECK:STDOUT: !44 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !48 = !{!"__libc_errno", !42, i64 0} +// CHECK:STDOUT: !49 = !{!48, !42, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'b.carbon' @@ -160,21 +161,21 @@ int UseB() { return Carbon::Other::Identity(4); } // CHECK:STDOUT: declare i32 @_CIdentity.Other(i32) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CIdentity__carbon_thunk.Other(ptr noundef nonnull align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) #2 !dbg !51 { +// CHECK:STDOUT: define linkonce_odr void @_CIdentity__carbon_thunk.Other(ptr noundef nonnull align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) #2 !dbg !52 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.1 = load i32, ptr %_, align 4, !dbg !54 -// CHECK:STDOUT: %Identity.call = call i32 @_CIdentity.Other(i32 %.1), !dbg !54 -// CHECK:STDOUT: store i32 %Identity.call, ptr %_1, align 4, !dbg !54 -// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: %.1 = load i32, ptr %_, align 4, !dbg !55 +// CHECK:STDOUT: %Identity.call = call i32 @_CIdentity.Other(i32 %.1), !dbg !55 +// CHECK:STDOUT: store i32 %Identity.call, ptr %_1, align 4, !dbg !55 +// CHECK:STDOUT: ret void, !dbg !55 // 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" } // CHECK:STDOUT: attributes #1 = { alwaysinline 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" } // CHECK:STDOUT: attributes #2 = { nounwind "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!50} -// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!48} +// CHECK:STDOUT: !llvm.dbg.cu = !{!51} +// CHECK:STDOUT: !llvm.module.flags = !{!44, !45, !46, !47, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!49} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -186,16 +187,17 @@ int UseB() { return Carbon::Other::Identity(4); } // CHECK:STDOUT: !41 = !{!"omnipotent char", !40, i64 0} // CHECK:STDOUT: !42 = !{!"int", !41, i64 0} // CHECK:STDOUT: !43 = !{!42, !42, i64 0} -// CHECK:STDOUT: !44 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !45 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !46 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !47 = !{!"__libc_errno", !42, i64 0} -// CHECK:STDOUT: !48 = !{!47, !42, i64 0} -// CHECK:STDOUT: !49 = !DIFile(filename: "b.carbon", directory: "") -// CHECK:STDOUT: !50 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !49, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Identity__carbon_thunk", linkageName: "_CIdentity__carbon_thunk.Other", scope: null, file: !18, line: 4, type: !34, spFlags: DISPFlagDefinition, unit: !50, retainedNodes: !55) -// CHECK:STDOUT: !52 = !DILocalVariable(arg: 1, scope: !51, type: !20) -// CHECK:STDOUT: !53 = !DILocalVariable(arg: 2, scope: !51, type: !20) -// CHECK:STDOUT: !54 = !DILocation(line: 4, column: 1, scope: !51) -// CHECK:STDOUT: !55 = !{!52, !53} +// CHECK:STDOUT: !44 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !45 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !46 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !47 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !48 = !{!"__libc_errno", !42, i64 0} +// CHECK:STDOUT: !49 = !{!48, !42, i64 0} +// CHECK:STDOUT: !50 = !DIFile(filename: "b.carbon", directory: "") +// CHECK:STDOUT: !51 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !50, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "Identity__carbon_thunk", linkageName: "_CIdentity__carbon_thunk.Other", scope: null, file: !18, line: 4, type: !34, spFlags: DISPFlagDefinition, unit: !51, retainedNodes: !56) +// CHECK:STDOUT: !53 = !DILocalVariable(arg: 1, scope: !52, type: !20) +// CHECK:STDOUT: !54 = !DILocalVariable(arg: 2, scope: !52, type: !20) +// CHECK:STDOUT: !55 = !DILocation(line: 4, column: 1, scope: !52) +// CHECK:STDOUT: !56 = !{!53, !54} // 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 5f7d9433c4fb..bd12b0a83c7f 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/cpp_run.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/cpp_run.carbon @@ -45,8 +45,8 @@ fn Run() { // CHECK:STDOUT: attributes #1 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!28, !29, !30, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!35} +// CHECK:STDOUT: !llvm.module.flags = !{!28, !29, !30, !31, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!36} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -58,12 +58,13 @@ fn Run() { // CHECK:STDOUT: !25 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !18, line: 8, type: !22, spFlags: DISPFlagDefinition, unit: !19) // CHECK:STDOUT: !26 = !DILocation(line: 9, column: 3, scope: !25) // CHECK:STDOUT: !27 = !DILocation(line: 8, column: 1, scope: !25) -// CHECK:STDOUT: !28 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !29 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !30 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !31 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !32 = !{!"omnipotent char", !31, i64 0} -// CHECK:STDOUT: !33 = !{!"int", !32, i64 0} -// CHECK:STDOUT: !34 = !{!"__libc_errno", !33, i64 0} -// CHECK:STDOUT: !35 = !{!34, !33, i64 0} +// CHECK:STDOUT: !28 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !29 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !30 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !31 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !32 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !33 = !{!"omnipotent char", !32, i64 0} +// CHECK:STDOUT: !34 = !{!"int", !33, i64 0} +// CHECK:STDOUT: !35 = !{!"__libc_errno", !34, i64 0} +// CHECK:STDOUT: !36 = !{!35, !34, i64 0} // 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 5362716353f6..1faf8da036a7 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon @@ -151,8 +151,8 @@ fn MyF() -> i32 { // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!32} +// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !28, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -163,14 +163,15 @@ fn MyF() -> i32 { // CHECK:STDOUT: !22 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !18, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !19) // CHECK:STDOUT: !23 = !DILocation(line: 7, column: 3, scope: !22) // CHECK:STDOUT: !24 = !DILocation(line: 6, column: 1, scope: !22) -// CHECK:STDOUT: !25 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !26 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !27 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !31 = !{!"__libc_errno", !30, i64 0} -// CHECK:STDOUT: !32 = !{!31, !30, i64 0} +// CHECK:STDOUT: !25 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !26 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !27 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !28 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !29 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !30 = !{!"omnipotent char", !29, i64 0} +// CHECK:STDOUT: !31 = !{!"int", !30, i64 0} +// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} +// CHECK:STDOUT: !33 = !{!32, !31, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_inline_function_decl.carbon' @@ -181,10 +182,10 @@ fn MyF() -> i32 { // CHECK:STDOUT: $_Z10foo_inlinev = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !35 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !36 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z10foo_inlinev(), !dbg !36 -// CHECK:STDOUT: ret void, !dbg !37 +// CHECK:STDOUT: call void @_Z10foo_inlinev(), !dbg !37 +// CHECK:STDOUT: ret void, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable @@ -196,27 +197,28 @@ fn MyF() -> i32 { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { inlinehint 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!34} -// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!32} +// CHECK:STDOUT: !llvm.dbg.cu = !{!35} +// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !28, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !20 = !{null} // CHECK:STDOUT: !21 = !DISubroutineType(types: !20) -// CHECK:STDOUT: !25 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !26 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !27 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !31 = !{!"__libc_errno", !30, i64 0} -// CHECK:STDOUT: !32 = !{!31, !30, i64 0} -// CHECK:STDOUT: !33 = !DIFile(filename: "import_inline_function_decl.carbon", directory: "") -// CHECK:STDOUT: !34 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !33, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !35 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !33, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !34) -// CHECK:STDOUT: !36 = !DILocation(line: 7, column: 3, scope: !35) -// CHECK:STDOUT: !37 = !DILocation(line: 6, column: 1, scope: !35) +// CHECK:STDOUT: !25 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !26 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !27 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !28 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !29 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !30 = !{!"omnipotent char", !29, i64 0} +// CHECK:STDOUT: !31 = !{!"int", !30, i64 0} +// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} +// CHECK:STDOUT: !33 = !{!32, !31, i64 0} +// CHECK:STDOUT: !34 = !DIFile(filename: "import_inline_function_decl.carbon", directory: "") +// CHECK:STDOUT: !35 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !34, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !34, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !35) +// CHECK:STDOUT: !37 = !DILocation(line: 7, column: 3, scope: !36) +// CHECK:STDOUT: !38 = !DILocation(line: 6, column: 1, scope: !36) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_inline_used_function_decl.carbon' @@ -235,10 +237,10 @@ fn MyF() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #1 !dbg !40 { +// CHECK:STDOUT: define void @_CMyF.Main() #1 !dbg !41 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z8foo_usedv(), !dbg !41 -// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: call void @_Z8foo_usedv(), !dbg !42 +// CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -247,27 +249,28 @@ fn MyF() -> i32 { // CHECK:STDOUT: attributes #0 = { inlinehint 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" } // CHECK:STDOUT: attributes #1 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!39} -// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!32} +// CHECK:STDOUT: !llvm.dbg.cu = !{!40} +// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !28, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !20 = !{null} // CHECK:STDOUT: !21 = !DISubroutineType(types: !20) -// CHECK:STDOUT: !25 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !26 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !27 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !31 = !{!"__libc_errno", !30, i64 0} -// CHECK:STDOUT: !32 = !{!31, !30, i64 0} -// CHECK:STDOUT: !38 = !DIFile(filename: "import_inline_used_function_decl.carbon", directory: "") -// CHECK:STDOUT: !39 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !38, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !38, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !39) -// CHECK:STDOUT: !41 = !DILocation(line: 7, column: 3, scope: !40) -// CHECK:STDOUT: !42 = !DILocation(line: 6, column: 1, scope: !40) +// CHECK:STDOUT: !25 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !26 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !27 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !28 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !29 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !30 = !{!"omnipotent char", !29, i64 0} +// CHECK:STDOUT: !31 = !{!"int", !30, i64 0} +// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} +// CHECK:STDOUT: !33 = !{!32, !31, i64 0} +// CHECK:STDOUT: !39 = !DIFile(filename: "import_inline_used_function_decl.carbon", directory: "") +// CHECK:STDOUT: !40 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !39, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !39, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !40) +// CHECK:STDOUT: !42 = !DILocation(line: 7, column: 3, scope: !41) +// CHECK:STDOUT: !43 = !DILocation(line: 6, column: 1, scope: !41) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_multiple_inline_function_decls.carbon' @@ -282,12 +285,12 @@ fn MyF() -> i32 { // CHECK:STDOUT: $_Z10multi_foo3v = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !45 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !46 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z10multi_foo1v(), !dbg !46 -// CHECK:STDOUT: call void @_Z10multi_foo2v(), !dbg !47 -// CHECK:STDOUT: call void @_Z10multi_foo3v(), !dbg !48 -// CHECK:STDOUT: ret void, !dbg !49 +// CHECK:STDOUT: call void @_Z10multi_foo1v(), !dbg !47 +// CHECK:STDOUT: call void @_Z10multi_foo2v(), !dbg !48 +// CHECK:STDOUT: call void @_Z10multi_foo3v(), !dbg !49 +// CHECK:STDOUT: ret void, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable @@ -311,29 +314,30 @@ fn MyF() -> i32 { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { inlinehint 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!44} -// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!32} +// CHECK:STDOUT: !llvm.dbg.cu = !{!45} +// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !28, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !20 = !{null} // CHECK:STDOUT: !21 = !DISubroutineType(types: !20) -// CHECK:STDOUT: !25 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !26 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !27 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !31 = !{!"__libc_errno", !30, i64 0} -// CHECK:STDOUT: !32 = !{!31, !30, i64 0} -// CHECK:STDOUT: !43 = !DIFile(filename: "import_multiple_inline_function_decls.carbon", directory: "") -// CHECK:STDOUT: !44 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !43, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !43, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !44) -// CHECK:STDOUT: !46 = !DILocation(line: 7, column: 3, scope: !45) -// CHECK:STDOUT: !47 = !DILocation(line: 8, column: 3, scope: !45) -// CHECK:STDOUT: !48 = !DILocation(line: 9, column: 3, scope: !45) -// CHECK:STDOUT: !49 = !DILocation(line: 6, column: 1, scope: !45) +// CHECK:STDOUT: !25 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !26 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !27 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !28 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !29 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !30 = !{!"omnipotent char", !29, i64 0} +// CHECK:STDOUT: !31 = !{!"int", !30, i64 0} +// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} +// CHECK:STDOUT: !33 = !{!32, !31, i64 0} +// CHECK:STDOUT: !44 = !DIFile(filename: "import_multiple_inline_function_decls.carbon", directory: "") +// CHECK:STDOUT: !45 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !44, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !46 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !44, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !45) +// CHECK:STDOUT: !47 = !DILocation(line: 7, column: 3, scope: !46) +// CHECK:STDOUT: !48 = !DILocation(line: 8, column: 3, scope: !46) +// CHECK:STDOUT: !49 = !DILocation(line: 9, column: 3, scope: !46) +// CHECK:STDOUT: !50 = !DILocation(line: 6, column: 1, scope: !46) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_inline_recursive_function_decl.carbon' @@ -346,10 +350,10 @@ fn MyF() -> i32 { // CHECK:STDOUT: $_Z8rec_foo1v = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !52 { +// CHECK:STDOUT: define void @_CMyF.Main() #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z8rec_foo2v(), !dbg !53 -// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: call void @_Z8rec_foo2v(), !dbg !54 +// CHECK:STDOUT: ret void, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress uwtable @@ -369,27 +373,28 @@ fn MyF() -> i32 { // CHECK:STDOUT: attributes #1 = { inlinehint 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" } // CHECK:STDOUT: attributes #2 = { inlinehint 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!51} -// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!32} +// CHECK:STDOUT: !llvm.dbg.cu = !{!52} +// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !28, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !20 = !{null} // CHECK:STDOUT: !21 = !DISubroutineType(types: !20) -// CHECK:STDOUT: !25 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !26 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !27 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !31 = !{!"__libc_errno", !30, i64 0} -// CHECK:STDOUT: !32 = !{!31, !30, i64 0} -// CHECK:STDOUT: !50 = !DIFile(filename: "import_inline_recursive_function_decl.carbon", directory: "") -// CHECK:STDOUT: !51 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !50, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !50, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !51) -// CHECK:STDOUT: !53 = !DILocation(line: 8, column: 3, scope: !52) -// CHECK:STDOUT: !54 = !DILocation(line: 6, column: 1, scope: !52) +// CHECK:STDOUT: !25 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !26 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !27 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !28 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !29 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !30 = !{!"omnipotent char", !29, i64 0} +// CHECK:STDOUT: !31 = !{!"int", !30, i64 0} +// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} +// CHECK:STDOUT: !33 = !{!32, !31, i64 0} +// CHECK:STDOUT: !51 = !DIFile(filename: "import_inline_recursive_function_decl.carbon", directory: "") +// CHECK:STDOUT: !52 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !51, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !51, line: 6, type: !21, spFlags: DISPFlagDefinition, unit: !52) +// CHECK:STDOUT: !54 = !DILocation(line: 8, column: 3, scope: !53) +// CHECK:STDOUT: !55 = !DILocation(line: 6, column: 1, scope: !53) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_with_default_args.carbon' @@ -398,22 +403,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 !68 { +// CHECK:STDOUT: define i32 @_CMyF.Main() #0 !dbg !69 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %value.var = alloca i32, align 4, !dbg !74 -// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk.(), !dbg !71 -// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk._(i32 3), !dbg !72 -// CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 3, i32 4), !dbg !73 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %value.var), !dbg !74 -// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc11 = call i32 @_Z17SimpleReturnValueii.carbon_thunk.(), !dbg !75 -// CHECK:STDOUT: store i32 %SimpleReturnValue__carbon_thunk.call.loc11, ptr %value.var, align 4, !dbg !74 -// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc12 = call i32 @_Z17SimpleReturnValueii.carbon_thunk._(i32 3), !dbg !78 -// CHECK:STDOUT: store i32 %SimpleReturnValue__carbon_thunk.call.loc12, ptr %value.var, align 4, !dbg !77 -// CHECK:STDOUT: %SimpleReturnValue.call = call i32 @_Z17SimpleReturnValueii(i32 3, i32 4), !dbg !80 -// CHECK:STDOUT: store i32 %SimpleReturnValue.call, ptr %value.var, align 4, !dbg !79 -// CHECK:STDOUT: %.loc14 = load i32, ptr %value.var, align 4, !dbg !81 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %value.var), !dbg !74 -// CHECK:STDOUT: ret i32 %.loc14, !dbg !82 +// CHECK:STDOUT: %value.var = alloca i32, align 4, !dbg !75 +// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk.(), !dbg !72 +// CHECK:STDOUT: call void @_Z13NoReturnValueii.carbon_thunk._(i32 3), !dbg !73 +// CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 3, i32 4), !dbg !74 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %value.var), !dbg !75 +// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc11 = call i32 @_Z17SimpleReturnValueii.carbon_thunk.(), !dbg !76 +// CHECK:STDOUT: store i32 %SimpleReturnValue__carbon_thunk.call.loc11, ptr %value.var, align 4, !dbg !75 +// CHECK:STDOUT: %SimpleReturnValue__carbon_thunk.call.loc12 = call i32 @_Z17SimpleReturnValueii.carbon_thunk._(i32 3), !dbg !79 +// CHECK:STDOUT: store i32 %SimpleReturnValue__carbon_thunk.call.loc12, ptr %value.var, align 4, !dbg !78 +// CHECK:STDOUT: %SimpleReturnValue.call = call i32 @_Z17SimpleReturnValueii(i32 3, i32 4), !dbg !81 +// CHECK:STDOUT: store i32 %SimpleReturnValue.call, ptr %value.var, align 4, !dbg !80 +// CHECK:STDOUT: %.loc14 = load i32, ptr %value.var, align 4, !dbg !82 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %value.var), !dbg !75 +// CHECK:STDOUT: ret i32 %.loc14, !dbg !83 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -427,8 +432,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 !90 -// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !90 +// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !91 +// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !91 // CHECK:STDOUT: call void @_Z13NoReturnValueii(i32 noundef %0, i32 noundef 2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -446,8 +451,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 !90 -// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !90 +// CHECK:STDOUT: store i32 %a, ptr %a.addr, align 4, !tbaa !91 +// CHECK:STDOUT: %0 = load i32, ptr %a.addr, align 4, !tbaa !91 // CHECK:STDOUT: %call = call noundef i32 @_Z17SimpleReturnValueii(i32 noundef %0, i32 noundef 2) // CHECK:STDOUT: ret i32 %call // CHECK:STDOUT: } @@ -458,8 +463,8 @@ fn MyF() -> i32 { // 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 @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #0 !dbg !83 { -// CHECK:STDOUT: ret void, !dbg !88 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #0 !dbg !84 { +// CHECK:STDOUT: ret void, !dbg !89 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -471,43 +476,44 @@ fn MyF() -> i32 { // CHECK:STDOUT: attributes #2 = { "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" } // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!56} -// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!32} +// CHECK:STDOUT: !llvm.dbg.cu = !{!57} +// CHECK:STDOUT: !llvm.module.flags = !{!25, !26, !27, !28, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !10 = !DIFile(filename: "min_prelude/parts/destroy.carbon", directory: "") -// CHECK:STDOUT: !25 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !26 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !27 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !28 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} -// CHECK:STDOUT: !30 = !{!"int", !29, i64 0} -// CHECK:STDOUT: !31 = !{!"__libc_errno", !30, i64 0} -// CHECK:STDOUT: !32 = !{!31, !30, i64 0} -// CHECK:STDOUT: !55 = !DIFile(filename: "call_with_default_args.carbon", directory: "") -// CHECK:STDOUT: !56 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !55, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !57 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !58 = !{!57} -// CHECK:STDOUT: !59 = !DISubroutineType(types: !58) -// CHECK:STDOUT: !60 = !{null, !57} -// CHECK:STDOUT: !61 = !DISubroutineType(types: !60) -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !55, line: 6, type: !59, spFlags: DISPFlagDefinition, unit: !56) -// CHECK:STDOUT: !71 = !DILocation(line: 7, column: 3, scope: !68) -// CHECK:STDOUT: !72 = !DILocation(line: 8, column: 3, scope: !68) -// CHECK:STDOUT: !73 = !DILocation(line: 9, column: 3, scope: !68) -// CHECK:STDOUT: !74 = !DILocation(line: 11, column: 3, scope: !68) -// CHECK:STDOUT: !75 = !DILocation(line: 11, column: 20, scope: !68) -// CHECK:STDOUT: !77 = !DILocation(line: 12, column: 3, scope: !68) -// CHECK:STDOUT: !78 = !DILocation(line: 12, column: 11, scope: !68) -// CHECK:STDOUT: !79 = !DILocation(line: 13, column: 3, scope: !68) -// CHECK:STDOUT: !80 = !DILocation(line: 13, column: 11, scope: !68) -// CHECK:STDOUT: !81 = !DILocation(line: 14, column: 10, scope: !68) -// CHECK:STDOUT: !82 = !DILocation(line: 14, column: 3, scope: !68) -// CHECK:STDOUT: !83 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !10, line: 32, type: !61, spFlags: DISPFlagDefinition, unit: !56, retainedNodes: !89) -// CHECK:STDOUT: !84 = !DILocalVariable(arg: 1, scope: !83, type: !57) -// CHECK:STDOUT: !88 = !DILocation(line: 32, column: 1, scope: !83) -// CHECK:STDOUT: !89 = !{!84} -// CHECK:STDOUT: !90 = !{!30, !30, i64 0} +// CHECK:STDOUT: !25 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !26 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !27 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !28 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !29 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !30 = !{!"omnipotent char", !29, i64 0} +// CHECK:STDOUT: !31 = !{!"int", !30, i64 0} +// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} +// CHECK:STDOUT: !33 = !{!32, !31, i64 0} +// CHECK:STDOUT: !56 = !DIFile(filename: "call_with_default_args.carbon", directory: "") +// CHECK:STDOUT: !57 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !56, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !58 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !59 = !{!58} +// CHECK:STDOUT: !60 = !DISubroutineType(types: !59) +// CHECK:STDOUT: !61 = !{null, !58} +// CHECK:STDOUT: !62 = !DISubroutineType(types: !61) +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !56, line: 6, type: !60, spFlags: DISPFlagDefinition, unit: !57) +// CHECK:STDOUT: !72 = !DILocation(line: 7, column: 3, scope: !69) +// CHECK:STDOUT: !73 = !DILocation(line: 8, column: 3, scope: !69) +// CHECK:STDOUT: !74 = !DILocation(line: 9, column: 3, scope: !69) +// CHECK:STDOUT: !75 = !DILocation(line: 11, column: 3, scope: !69) +// CHECK:STDOUT: !76 = !DILocation(line: 11, column: 20, scope: !69) +// CHECK:STDOUT: !78 = !DILocation(line: 12, column: 3, scope: !69) +// CHECK:STDOUT: !79 = !DILocation(line: 12, column: 11, scope: !69) +// CHECK:STDOUT: !80 = !DILocation(line: 13, column: 3, scope: !69) +// CHECK:STDOUT: !81 = !DILocation(line: 13, column: 11, scope: !69) +// CHECK:STDOUT: !82 = !DILocation(line: 14, column: 10, scope: !69) +// CHECK:STDOUT: !83 = !DILocation(line: 14, column: 3, scope: !69) +// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !10, line: 32, type: !62, spFlags: DISPFlagDefinition, unit: !57, retainedNodes: !90) +// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !58) +// CHECK:STDOUT: !89 = !DILocation(line: 32, column: 1, scope: !84) +// CHECK:STDOUT: !90 = !{!85} +// CHECK:STDOUT: !91 = !{!31, !31, i64 0} // 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 a2ccfa45b783..be372b46138b 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 @@ -57,8 +57,8 @@ fn F() { // CHECK:STDOUT: attributes #1 = { 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!36} +// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !35, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!37} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -73,9 +73,10 @@ fn F() { // CHECK:STDOUT: !29 = !{!"omnipotent char", !28, i64 0} // CHECK:STDOUT: !30 = !{!"int", !29, i64 0} // CHECK:STDOUT: !31 = !{!30, !30, i64 0} -// CHECK:STDOUT: !32 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !33 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !34 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !35 = !{!"__libc_errno", !30, i64 0} -// CHECK:STDOUT: !36 = !{!35, !30, i64 0} +// CHECK:STDOUT: !32 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !33 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !34 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !35 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !36 = !{!"__libc_errno", !30, i64 0} +// CHECK:STDOUT: !37 = !{!36, !30, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/import/function_ptr.carbon b/toolchain/lower/testdata/interop/cpp/function/import/function_ptr.carbon index 421561fd3f69..bdec76fcca85 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/function_ptr.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/function_ptr.carbon @@ -155,8 +155,8 @@ fn F() { // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!24} +// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !20, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!25} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -168,14 +168,15 @@ fn F() { // CHECK:STDOUT: !14 = !DILocation(line: 6, column: 20, scope: !13) // CHECK:STDOUT: !15 = !DILocation(line: 6, column: 3, scope: !13) // CHECK:STDOUT: !16 = !DILocation(line: 5, column: 1, scope: !13) -// CHECK:STDOUT: !17 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !18 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !19 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !20 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !21 = !{!"omnipotent char", !20, i64 0} -// CHECK:STDOUT: !22 = !{!"int", !21, i64 0} -// CHECK:STDOUT: !23 = !{!"__libc_errno", !22, i64 0} -// CHECK:STDOUT: !24 = !{!23, !22, i64 0} +// CHECK:STDOUT: !17 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !18 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !19 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !20 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !21 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !22 = !{!"omnipotent char", !21, i64 0} +// CHECK:STDOUT: !23 = !{!"int", !22, i64 0} +// CHECK:STDOUT: !24 = !{!"__libc_errno", !23, i64 0} +// CHECK:STDOUT: !25 = !{!24, !23, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'convert_fn_ptr.carbon' @@ -186,39 +187,39 @@ fn F() { // CHECK:STDOUT: declare i32 @_CMyCallback.Main(float) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !32 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !33 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %fn_ptr.var = alloca ptr, align 8, !dbg !33 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %fn_ptr.var), !dbg !33 -// CHECK:STDOUT: store ptr @_CMyCallback.Main, ptr %fn_ptr.var, align 8, !dbg !33 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %fn_ptr.var), !dbg !33 -// CHECK:STDOUT: ret void, !dbg !35 +// CHECK:STDOUT: %fn_ptr.var = alloca ptr, align 8, !dbg !34 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %fn_ptr.var), !dbg !34 +// CHECK:STDOUT: store ptr @_CMyCallback.Main, ptr %fn_ptr.var, align 8, !dbg !34 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %fn_ptr.var), !dbg !34 +// CHECK:STDOUT: ret void, !dbg !36 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CMyCallback__carbon_thunk.Main(ptr noundef nonnull align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) #1 !dbg !36 { +// CHECK:STDOUT: define linkonce_odr void @_CMyCallback__carbon_thunk.Main(ptr noundef nonnull align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) #1 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc8 = load float, ptr %_, align 4, !dbg !39 -// CHECK:STDOUT: %MyCallback.call = call i32 @_CMyCallback.Main(float %.loc8), !dbg !40 -// CHECK:STDOUT: store i32 %MyCallback.call, ptr %_1, align 4, !dbg !39 -// CHECK:STDOUT: ret void, !dbg !40 +// CHECK:STDOUT: %.loc8 = load float, ptr %_, align 4, !dbg !40 +// CHECK:STDOUT: %MyCallback.call = call i32 @_CMyCallback.Main(float %.loc8), !dbg !41 +// CHECK:STDOUT: store i32 %MyCallback.call, ptr %_1, align 4, !dbg !40 +// CHECK:STDOUT: ret void, !dbg !41 // 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 void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %t) #0 !dbg !43 { -// CHECK:STDOUT: ret void, !dbg !48 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %t) #0 !dbg !44 { +// CHECK:STDOUT: ret void, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nounwind "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" } // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!26} -// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!24} +// CHECK:STDOUT: !llvm.dbg.cu = !{!27} +// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !20, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!25} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -227,33 +228,34 @@ fn F() { // CHECK:STDOUT: !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !11 = !{null, !8} // CHECK:STDOUT: !12 = !DISubroutineType(types: !11) -// CHECK:STDOUT: !17 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !18 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !19 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !20 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !21 = !{!"omnipotent char", !20, i64 0} -// CHECK:STDOUT: !22 = !{!"int", !21, i64 0} -// CHECK:STDOUT: !23 = !{!"__libc_errno", !22, i64 0} -// CHECK:STDOUT: !24 = !{!23, !22, i64 0} -// CHECK:STDOUT: !25 = !DIFile(filename: "convert_fn_ptr.carbon", directory: "") -// CHECK:STDOUT: !26 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !25, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !27 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !30 = !{null, !8, !27} -// CHECK:STDOUT: !31 = !DISubroutineType(types: !30) -// CHECK:STDOUT: !32 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !25, line: 7, type: !7, spFlags: DISPFlagDefinition, unit: !26) -// CHECK:STDOUT: !33 = !DILocation(line: 8, column: 3, scope: !32) -// CHECK:STDOUT: !35 = !DILocation(line: 7, column: 1, scope: !32) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "MyCallback__carbon_thunk", linkageName: "_CMyCallback__carbon_thunk.Main", scope: null, file: !25, line: 8, type: !31, spFlags: DISPFlagDefinition, unit: !26, retainedNodes: !41) -// CHECK:STDOUT: !37 = !DILocalVariable(arg: 1, scope: !36, type: !8) -// CHECK:STDOUT: !38 = !DILocalVariable(arg: 2, scope: !36, type: !27) -// CHECK:STDOUT: !39 = !DILocation(line: 8, column: 41, scope: !36) -// CHECK:STDOUT: !40 = !DILocation(line: 5, column: 1, scope: !36) -// CHECK:STDOUT: !41 = !{!37, !38} -// CHECK:STDOUT: !42 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") -// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.9d0db8a57c58fabc", scope: null, file: !42, line: 36, type: !12, spFlags: DISPFlagDefinition, unit: !26, retainedNodes: !49) -// CHECK:STDOUT: !44 = !DILocalVariable(arg: 1, scope: !43, type: !8) -// CHECK:STDOUT: !48 = !DILocation(line: 36, column: 1, scope: !43) -// CHECK:STDOUT: !49 = !{!44} +// CHECK:STDOUT: !17 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !18 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !19 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !20 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !21 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !22 = !{!"omnipotent char", !21, i64 0} +// CHECK:STDOUT: !23 = !{!"int", !22, i64 0} +// CHECK:STDOUT: !24 = !{!"__libc_errno", !23, i64 0} +// CHECK:STDOUT: !25 = !{!24, !23, i64 0} +// CHECK:STDOUT: !26 = !DIFile(filename: "convert_fn_ptr.carbon", directory: "") +// CHECK:STDOUT: !27 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !26, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !28 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !31 = !{null, !8, !28} +// CHECK:STDOUT: !32 = !DISubroutineType(types: !31) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !26, line: 7, type: !7, spFlags: DISPFlagDefinition, unit: !27) +// CHECK:STDOUT: !34 = !DILocation(line: 8, column: 3, scope: !33) +// CHECK:STDOUT: !36 = !DILocation(line: 7, column: 1, scope: !33) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "MyCallback__carbon_thunk", linkageName: "_CMyCallback__carbon_thunk.Main", scope: null, file: !26, line: 8, type: !32, spFlags: DISPFlagDefinition, unit: !27, retainedNodes: !42) +// CHECK:STDOUT: !38 = !DILocalVariable(arg: 1, scope: !37, type: !8) +// CHECK:STDOUT: !39 = !DILocalVariable(arg: 2, scope: !37, type: !28) +// CHECK:STDOUT: !40 = !DILocation(line: 8, column: 41, scope: !37) +// CHECK:STDOUT: !41 = !DILocation(line: 5, column: 1, scope: !37) +// CHECK:STDOUT: !42 = !{!38, !39} +// CHECK:STDOUT: !43 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") +// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.9d0db8a57c58fabc", scope: null, file: !43, line: 36, type: !12, spFlags: DISPFlagDefinition, unit: !27, retainedNodes: !50) +// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !8) +// CHECK:STDOUT: !49 = !DILocation(line: 36, column: 1, scope: !44) +// CHECK:STDOUT: !50 = !{!45} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'pass_fn_ptr.carbon' @@ -264,19 +266,19 @@ fn F() { // CHECK:STDOUT: declare i32 @_CMyCallback.Main(float) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !52 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !53 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z12TakeCallbackPFifE(ptr @_CMyCallback.Main), !dbg !53 -// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: call void @_Z12TakeCallbackPFifE(ptr @_CMyCallback.Main), !dbg !54 +// CHECK:STDOUT: ret void, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CMyCallback__carbon_thunk.Main(ptr noundef nonnull align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) #1 !dbg !55 { +// CHECK:STDOUT: define linkonce_odr void @_CMyCallback__carbon_thunk.Main(ptr noundef nonnull align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) #1 !dbg !56 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc5 = load float, ptr %_, align 4, !dbg !58 -// CHECK:STDOUT: %MyCallback.call = call i32 @_CMyCallback.Main(float %.loc5), !dbg !58 -// CHECK:STDOUT: store i32 %MyCallback.call, ptr %_1, align 4, !dbg !58 -// CHECK:STDOUT: ret void, !dbg !58 +// CHECK:STDOUT: %.loc5 = load float, ptr %_, align 4, !dbg !59 +// CHECK:STDOUT: %MyCallback.call = call i32 @_CMyCallback.Main(float %.loc5), !dbg !59 +// CHECK:STDOUT: store i32 %MyCallback.call, ptr %_1, align 4, !dbg !59 +// CHECK:STDOUT: ret void, !dbg !59 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z12TakeCallbackPFifE(ptr noundef) #2 @@ -285,36 +287,37 @@ fn F() { // CHECK:STDOUT: attributes #1 = { nounwind "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" } // CHECK:STDOUT: attributes #2 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!51} -// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!24} +// CHECK:STDOUT: !llvm.dbg.cu = !{!52} +// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !20, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!25} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !6 = !{null} // CHECK:STDOUT: !7 = !DISubroutineType(types: !6) // CHECK:STDOUT: !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !17 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !18 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !19 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !20 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !21 = !{!"omnipotent char", !20, i64 0} -// CHECK:STDOUT: !22 = !{!"int", !21, i64 0} -// CHECK:STDOUT: !23 = !{!"__libc_errno", !22, i64 0} -// CHECK:STDOUT: !24 = !{!23, !22, i64 0} -// CHECK:STDOUT: !27 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !30 = !{null, !8, !27} -// CHECK:STDOUT: !31 = !DISubroutineType(types: !30) -// CHECK:STDOUT: !50 = !DIFile(filename: "pass_fn_ptr.carbon", directory: "") -// CHECK:STDOUT: !51 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !50, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !52 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !50, line: 7, type: !7, spFlags: DISPFlagDefinition, unit: !51) -// CHECK:STDOUT: !53 = !DILocation(line: 8, column: 3, scope: !52) -// CHECK:STDOUT: !54 = !DILocation(line: 7, column: 1, scope: !52) -// CHECK:STDOUT: !55 = distinct !DISubprogram(name: "MyCallback__carbon_thunk", linkageName: "_CMyCallback__carbon_thunk.Main", scope: null, file: !50, line: 5, type: !31, spFlags: DISPFlagDefinition, unit: !51, retainedNodes: !59) -// CHECK:STDOUT: !56 = !DILocalVariable(arg: 1, scope: !55, type: !8) -// CHECK:STDOUT: !57 = !DILocalVariable(arg: 2, scope: !55, type: !27) -// CHECK:STDOUT: !58 = !DILocation(line: 5, column: 1, scope: !55) -// CHECK:STDOUT: !59 = !{!56, !57} +// CHECK:STDOUT: !17 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !18 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !19 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !20 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !21 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !22 = !{!"omnipotent char", !21, i64 0} +// CHECK:STDOUT: !23 = !{!"int", !22, i64 0} +// CHECK:STDOUT: !24 = !{!"__libc_errno", !23, i64 0} +// CHECK:STDOUT: !25 = !{!24, !23, i64 0} +// CHECK:STDOUT: !28 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !31 = !{null, !8, !28} +// CHECK:STDOUT: !32 = !DISubroutineType(types: !31) +// CHECK:STDOUT: !51 = !DIFile(filename: "pass_fn_ptr.carbon", directory: "") +// CHECK:STDOUT: !52 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !51, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !51, line: 7, type: !7, spFlags: DISPFlagDefinition, unit: !52) +// CHECK:STDOUT: !54 = !DILocation(line: 8, column: 3, scope: !53) +// CHECK:STDOUT: !55 = !DILocation(line: 7, column: 1, scope: !53) +// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "MyCallback__carbon_thunk", linkageName: "_CMyCallback__carbon_thunk.Main", scope: null, file: !51, line: 5, type: !32, spFlags: DISPFlagDefinition, unit: !52, retainedNodes: !60) +// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !8) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 2, scope: !56, type: !28) +// CHECK:STDOUT: !59 = !DILocation(line: 5, column: 1, scope: !56) +// CHECK:STDOUT: !60 = !{!57, !58} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_fn_ptr.carbon' @@ -325,18 +328,18 @@ fn F() { // CHECK:STDOUT: @float.239 = internal constant float 1.000000e+00 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !64 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !65 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %x.var = alloca i32, align 4, !dbg !65 -// CHECK:STDOUT: %.loc6_41.3.temp = alloca float, align 4, !dbg !67 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !65 -// CHECK:STDOUT: %GetCallback.call = call ptr @_Z11GetCallbackv(), !dbg !66 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc6_41.3.temp), !dbg !67 -// CHECK:STDOUT: %__invoke__carbon_thunk.call = call i32 @.carbon_thunk.__(ptr %GetCallback.call, ptr @float.239), !dbg !66 -// CHECK:STDOUT: store i32 %__invoke__carbon_thunk.call, ptr %x.var, align 4, !dbg !65 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.37bc9e7c9d2f29bc(ptr @float.239), !dbg !67 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %x.var), !dbg !65 -// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: %x.var = alloca i32, align 4, !dbg !66 +// CHECK:STDOUT: %.loc6_41.3.temp = alloca float, align 4, !dbg !68 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !66 +// CHECK:STDOUT: %GetCallback.call = call ptr @_Z11GetCallbackv(), !dbg !67 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc6_41.3.temp), !dbg !68 +// CHECK:STDOUT: %__invoke__carbon_thunk.call = call i32 @.carbon_thunk.__(ptr %GetCallback.call, ptr @float.239), !dbg !67 +// CHECK:STDOUT: store i32 %__invoke__carbon_thunk.call, ptr %x.var, align 4, !dbg !66 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.37bc9e7c9d2f29bc(ptr @float.239), !dbg !68 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %x.var), !dbg !66 +// CHECK:STDOUT: ret void, !dbg !72 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z11GetCallbackv() #1 @@ -346,11 +349,11 @@ fn F() { // 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 !87 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !90 -// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !87 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !90 -// CHECK:STDOUT: %3 = load float, ptr %2, align 4, !tbaa !91 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !88 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !91 +// CHECK:STDOUT: %1 = load ptr, ptr %this.addr, align 8, !tbaa !88 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !91 +// CHECK:STDOUT: %3 = load float, ptr %2, align 4, !tbaa !92 // CHECK:STDOUT: %call = call noundef i32 %1(float noundef %3) // CHECK:STDOUT: ret i32 %call // CHECK:STDOUT: } @@ -359,13 +362,13 @@ fn F() { // 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 @_CSelfDestruct.Core.37bc9e7c9d2f29bc(ptr %t) #0 !dbg !72 { -// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.37bc9e7c9d2f29bc(ptr %t) #0 !dbg !73 { +// CHECK:STDOUT: ret void, !dbg !78 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #0 !dbg !79 { -// CHECK:STDOUT: ret void, !dbg !84 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #0 !dbg !80 { +// CHECK:STDOUT: ret void, !dbg !85 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -376,9 +379,9 @@ fn F() { // CHECK:STDOUT: attributes #2 = { alwaysinline 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" } // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!61} -// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!24} +// CHECK:STDOUT: !llvm.dbg.cu = !{!62} +// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !20, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!25} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -387,39 +390,40 @@ fn F() { // CHECK:STDOUT: !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !11 = !{null, !8} // CHECK:STDOUT: !12 = !DISubroutineType(types: !11) -// CHECK:STDOUT: !17 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !18 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !19 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !20 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !21 = !{!"omnipotent char", !20, i64 0} -// CHECK:STDOUT: !22 = !{!"int", !21, i64 0} -// CHECK:STDOUT: !23 = !{!"__libc_errno", !22, i64 0} -// CHECK:STDOUT: !24 = !{!23, !22, i64 0} -// CHECK:STDOUT: !27 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !42 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") -// CHECK:STDOUT: !60 = !DIFile(filename: "call_fn_ptr.carbon", directory: "") -// CHECK:STDOUT: !61 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !60, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !64 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !60, line: 5, type: !7, spFlags: DISPFlagDefinition, unit: !61) -// CHECK:STDOUT: !65 = !DILocation(line: 6, column: 3, scope: !64) -// CHECK:STDOUT: !66 = !DILocation(line: 6, column: 23, scope: !64) -// CHECK:STDOUT: !67 = !DILocation(line: 6, column: 41, scope: !64) -// CHECK:STDOUT: !69 = !{null, !27} -// CHECK:STDOUT: !70 = !DISubroutineType(types: !69) -// CHECK:STDOUT: !71 = !DILocation(line: 5, column: 1, scope: !64) -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.37bc9e7c9d2f29bc", scope: null, file: !42, line: 36, type: !12, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !78) -// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !8) -// CHECK:STDOUT: !77 = !DILocation(line: 36, column: 1, scope: !72) -// CHECK:STDOUT: !78 = !{!73} -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !42, line: 36, type: !70, spFlags: DISPFlagDefinition, unit: !61, retainedNodes: !85) -// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !27) -// CHECK:STDOUT: !84 = !DILocation(line: 36, column: 1, scope: !79) -// CHECK:STDOUT: !85 = !{!80} -// CHECK:STDOUT: !86 = !{!"any pointer", !21, i64 0} -// CHECK:STDOUT: !87 = !{!86, !86, i64 0} -// CHECK:STDOUT: !88 = !{!"float", !21, i64 0} -// CHECK:STDOUT: !89 = !{!"p1 float", !86, i64 0} -// CHECK:STDOUT: !90 = !{!89, !89, i64 0} -// CHECK:STDOUT: !91 = !{!88, !88, i64 0} +// CHECK:STDOUT: !17 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !18 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !19 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !20 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !21 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !22 = !{!"omnipotent char", !21, i64 0} +// CHECK:STDOUT: !23 = !{!"int", !22, i64 0} +// CHECK:STDOUT: !24 = !{!"__libc_errno", !23, i64 0} +// CHECK:STDOUT: !25 = !{!24, !23, i64 0} +// CHECK:STDOUT: !28 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !43 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") +// CHECK:STDOUT: !61 = !DIFile(filename: "call_fn_ptr.carbon", directory: "") +// CHECK:STDOUT: !62 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !61, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !61, line: 5, type: !7, spFlags: DISPFlagDefinition, unit: !62) +// CHECK:STDOUT: !66 = !DILocation(line: 6, column: 3, scope: !65) +// CHECK:STDOUT: !67 = !DILocation(line: 6, column: 23, scope: !65) +// CHECK:STDOUT: !68 = !DILocation(line: 6, column: 41, scope: !65) +// CHECK:STDOUT: !70 = !{null, !28} +// CHECK:STDOUT: !71 = !DISubroutineType(types: !70) +// CHECK:STDOUT: !72 = !DILocation(line: 5, column: 1, scope: !65) +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.37bc9e7c9d2f29bc", scope: null, file: !43, line: 36, type: !12, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !79) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !8) +// CHECK:STDOUT: !78 = !DILocation(line: 36, column: 1, scope: !73) +// CHECK:STDOUT: !79 = !{!74} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !43, line: 36, type: !71, spFlags: DISPFlagDefinition, unit: !62, retainedNodes: !86) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 1, scope: !80, type: !28) +// CHECK:STDOUT: !85 = !DILocation(line: 36, column: 1, scope: !80) +// CHECK:STDOUT: !86 = !{!81} +// CHECK:STDOUT: !87 = !{!"any pointer", !22, i64 0} +// CHECK:STDOUT: !88 = !{!87, !87, i64 0} +// CHECK:STDOUT: !89 = !{!"float", !22, i64 0} +// CHECK:STDOUT: !90 = !{!"p1 float", !87, i64 0} +// CHECK:STDOUT: !91 = !{!90, !90, i64 0} +// CHECK:STDOUT: !92 = !{!89, !89, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'relay_complex_fn_ptr.carbon' @@ -428,11 +432,11 @@ fn F() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !94 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !95 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %GetComplexCallback.call = call ptr @_Z18GetComplexCallbackv(), !dbg !95 -// CHECK:STDOUT: call void @_Z19TakeComplexCallbackPF1CS_E(ptr %GetComplexCallback.call), !dbg !96 -// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: %GetComplexCallback.call = call ptr @_Z18GetComplexCallbackv(), !dbg !96 +// CHECK:STDOUT: call void @_Z19TakeComplexCallbackPF1CS_E(ptr %GetComplexCallback.call), !dbg !97 +// CHECK:STDOUT: ret void, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z18GetComplexCallbackv() #1 @@ -442,28 +446,29 @@ fn F() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!93} -// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!24} +// CHECK:STDOUT: !llvm.dbg.cu = !{!94} +// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !20, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!25} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !6 = !{null} // CHECK:STDOUT: !7 = !DISubroutineType(types: !6) -// CHECK:STDOUT: !17 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !18 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !19 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !20 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !21 = !{!"omnipotent char", !20, i64 0} -// CHECK:STDOUT: !22 = !{!"int", !21, i64 0} -// CHECK:STDOUT: !23 = !{!"__libc_errno", !22, i64 0} -// CHECK:STDOUT: !24 = !{!23, !22, i64 0} -// CHECK:STDOUT: !92 = !DIFile(filename: "relay_complex_fn_ptr.carbon", directory: "") -// CHECK:STDOUT: !93 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !92, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !92, line: 5, type: !7, spFlags: DISPFlagDefinition, unit: !93) -// CHECK:STDOUT: !95 = !DILocation(line: 6, column: 27, scope: !94) -// CHECK:STDOUT: !96 = !DILocation(line: 6, column: 3, scope: !94) -// CHECK:STDOUT: !97 = !DILocation(line: 5, column: 1, scope: !94) +// CHECK:STDOUT: !17 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !18 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !19 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !20 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !21 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !22 = !{!"omnipotent char", !21, i64 0} +// CHECK:STDOUT: !23 = !{!"int", !22, i64 0} +// CHECK:STDOUT: !24 = !{!"__libc_errno", !23, i64 0} +// CHECK:STDOUT: !25 = !{!24, !23, i64 0} +// CHECK:STDOUT: !93 = !DIFile(filename: "relay_complex_fn_ptr.carbon", directory: "") +// CHECK:STDOUT: !94 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !93, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !93, line: 5, type: !7, spFlags: DISPFlagDefinition, unit: !94) +// CHECK:STDOUT: !96 = !DILocation(line: 6, column: 27, scope: !95) +// CHECK:STDOUT: !97 = !DILocation(line: 6, column: 3, scope: !95) +// CHECK:STDOUT: !98 = !DILocation(line: 5, column: 1, scope: !95) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'convert_complex_fn_ptr.carbon' @@ -474,37 +479,37 @@ fn F() { // CHECK:STDOUT: declare void @_CMyCallback.Main(ptr sret([4 x i8]), ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !104 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !105 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %fn_ptr.var = alloca ptr, align 8, !dbg !105 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %fn_ptr.var), !dbg !105 -// CHECK:STDOUT: store ptr @_CMyCallback.Main, ptr %fn_ptr.var, align 8, !dbg !105 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %fn_ptr.var), !dbg !105 -// CHECK:STDOUT: ret void, !dbg !107 +// CHECK:STDOUT: %fn_ptr.var = alloca ptr, align 8, !dbg !106 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %fn_ptr.var), !dbg !106 +// CHECK:STDOUT: store ptr @_CMyCallback.Main, ptr %fn_ptr.var, align 8, !dbg !106 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %fn_ptr.var), !dbg !106 +// CHECK:STDOUT: ret void, !dbg !108 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CMyCallback__carbon_thunk.Main(ptr noundef nonnull align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) #1 !dbg !108 { +// CHECK:STDOUT: define linkonce_odr void @_CMyCallback__carbon_thunk.Main(ptr noundef nonnull align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) #1 !dbg !109 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CMyCallback.Main(ptr %_1, ptr %_), !dbg !112 -// CHECK:STDOUT: ret void, !dbg !112 +// CHECK:STDOUT: call void @_CMyCallback.Main(ptr %_1, ptr %_), !dbg !113 +// CHECK:STDOUT: ret void, !dbg !113 // 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 void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %t) #0 !dbg !114 { -// CHECK:STDOUT: ret void, !dbg !119 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %t) #0 !dbg !115 { +// CHECK:STDOUT: ret void, !dbg !120 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { nounwind "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" } // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!99} -// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!24} +// CHECK:STDOUT: !llvm.dbg.cu = !{!100} +// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !20, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!25} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -513,31 +518,32 @@ fn F() { // CHECK:STDOUT: !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !11 = !{null, !8} // CHECK:STDOUT: !12 = !DISubroutineType(types: !11) -// CHECK:STDOUT: !17 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !18 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !19 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !20 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !21 = !{!"omnipotent char", !20, i64 0} -// CHECK:STDOUT: !22 = !{!"int", !21, i64 0} -// CHECK:STDOUT: !23 = !{!"__libc_errno", !22, i64 0} -// CHECK:STDOUT: !24 = !{!23, !22, i64 0} -// CHECK:STDOUT: !42 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") -// CHECK:STDOUT: !98 = !DIFile(filename: "convert_complex_fn_ptr.carbon", directory: "") -// CHECK:STDOUT: !99 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !98, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !102 = !{null, !8, !8} -// CHECK:STDOUT: !103 = !DISubroutineType(types: !102) -// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !98, line: 7, type: !7, spFlags: DISPFlagDefinition, unit: !99) -// CHECK:STDOUT: !105 = !DILocation(line: 8, column: 3, scope: !104) -// CHECK:STDOUT: !107 = !DILocation(line: 7, column: 1, scope: !104) -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "MyCallback__carbon_thunk", linkageName: "_CMyCallback__carbon_thunk.Main", scope: null, file: !98, line: 8, type: !103, spFlags: DISPFlagDefinition, unit: !99, retainedNodes: !113) -// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !108, type: !8) -// CHECK:STDOUT: !110 = !DILocalVariable(arg: 2, scope: !108, type: !8) -// CHECK:STDOUT: !112 = !DILocation(line: 5, column: 1, scope: !108) -// CHECK:STDOUT: !113 = !{!109, !110} -// CHECK:STDOUT: !114 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.9d0db8a57c58fabc", scope: null, file: !42, line: 36, type: !12, spFlags: DISPFlagDefinition, unit: !99, retainedNodes: !120) -// CHECK:STDOUT: !115 = !DILocalVariable(arg: 1, scope: !114, type: !8) -// CHECK:STDOUT: !119 = !DILocation(line: 36, column: 1, scope: !114) -// CHECK:STDOUT: !120 = !{!115} +// CHECK:STDOUT: !17 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !18 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !19 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !20 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !21 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !22 = !{!"omnipotent char", !21, i64 0} +// CHECK:STDOUT: !23 = !{!"int", !22, i64 0} +// CHECK:STDOUT: !24 = !{!"__libc_errno", !23, i64 0} +// CHECK:STDOUT: !25 = !{!24, !23, i64 0} +// CHECK:STDOUT: !43 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") +// CHECK:STDOUT: !99 = !DIFile(filename: "convert_complex_fn_ptr.carbon", directory: "") +// CHECK:STDOUT: !100 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !99, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !103 = !{null, !8, !8} +// CHECK:STDOUT: !104 = !DISubroutineType(types: !103) +// CHECK:STDOUT: !105 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !99, line: 7, type: !7, spFlags: DISPFlagDefinition, unit: !100) +// CHECK:STDOUT: !106 = !DILocation(line: 8, column: 3, scope: !105) +// CHECK:STDOUT: !108 = !DILocation(line: 7, column: 1, scope: !105) +// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "MyCallback__carbon_thunk", linkageName: "_CMyCallback__carbon_thunk.Main", scope: null, file: !99, line: 8, type: !104, spFlags: DISPFlagDefinition, unit: !100, retainedNodes: !114) +// CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !109, type: !8) +// CHECK:STDOUT: !111 = !DILocalVariable(arg: 2, scope: !109, type: !8) +// CHECK:STDOUT: !113 = !DILocation(line: 5, column: 1, scope: !109) +// CHECK:STDOUT: !114 = !{!110, !111} +// CHECK:STDOUT: !115 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.9d0db8a57c58fabc", scope: null, file: !43, line: 36, type: !12, spFlags: DISPFlagDefinition, unit: !100, retainedNodes: !121) +// CHECK:STDOUT: !116 = !DILocalVariable(arg: 1, scope: !115, type: !8) +// CHECK:STDOUT: !120 = !DILocation(line: 36, column: 1, scope: !115) +// CHECK:STDOUT: !121 = !{!116} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'pass_complex_fn_ptr.carbon' @@ -548,17 +554,17 @@ fn F() { // CHECK:STDOUT: declare void @_CMyCallback.Main(ptr sret([4 x i8]), ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !123 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !124 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z19TakeComplexCallbackPF1CS_E(ptr @_CMyCallback.Main), !dbg !124 -// CHECK:STDOUT: ret void, !dbg !125 +// CHECK:STDOUT: call void @_Z19TakeComplexCallbackPF1CS_E(ptr @_CMyCallback.Main), !dbg !125 +// CHECK:STDOUT: ret void, !dbg !126 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CMyCallback__carbon_thunk.Main(ptr noundef nonnull align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) #1 !dbg !126 { +// CHECK:STDOUT: define linkonce_odr void @_CMyCallback__carbon_thunk.Main(ptr noundef nonnull align 4 dereferenceable(4) %_, ptr noundef nonnull align 4 dereferenceable(4) %_1) #1 !dbg !127 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CMyCallback.Main(ptr %_1, ptr %_), !dbg !129 -// CHECK:STDOUT: ret void, !dbg !129 +// CHECK:STDOUT: call void @_CMyCallback.Main(ptr %_1, ptr %_), !dbg !130 +// CHECK:STDOUT: ret void, !dbg !130 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z19TakeComplexCallbackPF1CS_E(ptr noundef) #2 @@ -567,35 +573,36 @@ fn F() { // CHECK:STDOUT: attributes #1 = { nounwind "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" } // CHECK:STDOUT: attributes #2 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!122} -// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!24} +// CHECK:STDOUT: !llvm.dbg.cu = !{!123} +// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !20, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!25} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !6 = !{null} // CHECK:STDOUT: !7 = !DISubroutineType(types: !6) // CHECK:STDOUT: !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !17 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !18 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !19 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !20 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !21 = !{!"omnipotent char", !20, i64 0} -// CHECK:STDOUT: !22 = !{!"int", !21, i64 0} -// CHECK:STDOUT: !23 = !{!"__libc_errno", !22, i64 0} -// CHECK:STDOUT: !24 = !{!23, !22, i64 0} -// CHECK:STDOUT: !102 = !{null, !8, !8} -// CHECK:STDOUT: !103 = !DISubroutineType(types: !102) -// CHECK:STDOUT: !121 = !DIFile(filename: "pass_complex_fn_ptr.carbon", directory: "") -// CHECK:STDOUT: !122 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !121, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !121, line: 7, type: !7, spFlags: DISPFlagDefinition, unit: !122) -// CHECK:STDOUT: !124 = !DILocation(line: 8, column: 3, scope: !123) -// CHECK:STDOUT: !125 = !DILocation(line: 7, column: 1, scope: !123) -// CHECK:STDOUT: !126 = distinct !DISubprogram(name: "MyCallback__carbon_thunk", linkageName: "_CMyCallback__carbon_thunk.Main", scope: null, file: !121, line: 5, type: !103, spFlags: DISPFlagDefinition, unit: !122, retainedNodes: !130) -// CHECK:STDOUT: !127 = !DILocalVariable(arg: 1, scope: !126, type: !8) -// CHECK:STDOUT: !128 = !DILocalVariable(arg: 2, scope: !126, type: !8) -// CHECK:STDOUT: !129 = !DILocation(line: 5, column: 1, scope: !126) -// CHECK:STDOUT: !130 = !{!127, !128} +// CHECK:STDOUT: !17 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !18 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !19 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !20 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !21 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !22 = !{!"omnipotent char", !21, i64 0} +// CHECK:STDOUT: !23 = !{!"int", !22, i64 0} +// CHECK:STDOUT: !24 = !{!"__libc_errno", !23, i64 0} +// CHECK:STDOUT: !25 = !{!24, !23, i64 0} +// CHECK:STDOUT: !103 = !{null, !8, !8} +// CHECK:STDOUT: !104 = !DISubroutineType(types: !103) +// CHECK:STDOUT: !122 = !DIFile(filename: "pass_complex_fn_ptr.carbon", directory: "") +// CHECK:STDOUT: !123 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !122, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !124 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !122, line: 7, type: !7, spFlags: DISPFlagDefinition, unit: !123) +// CHECK:STDOUT: !125 = !DILocation(line: 8, column: 3, scope: !124) +// CHECK:STDOUT: !126 = !DILocation(line: 7, column: 1, scope: !124) +// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "MyCallback__carbon_thunk", linkageName: "_CMyCallback__carbon_thunk.Main", scope: null, file: !122, line: 5, type: !104, spFlags: DISPFlagDefinition, unit: !123, retainedNodes: !131) +// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !8) +// CHECK:STDOUT: !129 = !DILocalVariable(arg: 2, scope: !127, type: !8) +// CHECK:STDOUT: !130 = !DILocation(line: 5, column: 1, scope: !127) +// CHECK:STDOUT: !131 = !{!128, !129} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'call_complex_fn_ptr.carbon' @@ -606,18 +613,18 @@ fn F() { // CHECK:STDOUT: %class.C = type { i32 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !135 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !136 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %x.var = alloca [4 x i8], align 4, !dbg !136 -// CHECK:STDOUT: %.loc6_58.1.temp = alloca [4 x i8], align 4, !dbg !138 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !136 -// CHECK:STDOUT: %GetComplexCallback.call = call ptr @_Z18GetComplexCallbackv(), !dbg !137 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc6_58.1.temp), !dbg !138 -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %.loc6_58.1.temp), !dbg !138 -// CHECK:STDOUT: call void @.carbon_thunk.__(ptr %GetComplexCallback.call, ptr %.loc6_58.1.temp, ptr %x.var), !dbg !137 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %.loc6_58.1.temp), !dbg !138 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %x.var), !dbg !136 -// CHECK:STDOUT: ret void, !dbg !140 +// CHECK:STDOUT: %x.var = alloca [4 x i8], align 4, !dbg !137 +// CHECK:STDOUT: %.loc6_58.1.temp = alloca [4 x i8], align 4, !dbg !139 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !137 +// CHECK:STDOUT: %GetComplexCallback.call = call ptr @_Z18GetComplexCallbackv(), !dbg !138 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc6_58.1.temp), !dbg !139 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %.loc6_58.1.temp), !dbg !139 +// CHECK:STDOUT: call void @.carbon_thunk.__(ptr %GetComplexCallback.call, ptr %.loc6_58.1.temp, ptr %x.var), !dbg !138 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %.loc6_58.1.temp), !dbg !139 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %x.var), !dbg !137 +// CHECK:STDOUT: ret void, !dbg !141 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z18GetComplexCallbackv() #1 @@ -626,8 +633,8 @@ fn F() { // CHECK:STDOUT: define internal void @_ZN1CC1Ev.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 !149 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !149 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !150 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !150 // CHECK:STDOUT: call void @_ZN1CC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -639,12 +646,12 @@ fn F() { // CHECK:STDOUT: %.addr = alloca ptr, align 8 // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %class.C, align 4 -// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !87 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !149 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !149 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !149 -// CHECK:STDOUT: %2 = load ptr, ptr %this.addr, align 8, !tbaa !87 -// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !149 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !88 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !150 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !150 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !150 +// CHECK:STDOUT: %2 = load ptr, ptr %this.addr, align 8, !tbaa !88 +// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !150 // CHECK:STDOUT: call void @_ZN1CC1ERKS_(ptr noundef nonnull align 4 dereferenceable(4) %agg.tmp, ptr noundef nonnull align 4 dereferenceable(4) %3) // CHECK:STDOUT: call void %2(ptr dead_on_unwind writable sret(%class.C) align 4 %1, ptr nofreeobj noundef align 4 dead_on_return dereferenceable(4) %agg.tmp) // CHECK:STDOUT: ret void @@ -654,8 +661,8 @@ fn F() { // 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 @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %t) #0 !dbg !141 { -// CHECK:STDOUT: ret void, !dbg !146 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %t) #0 !dbg !142 { +// CHECK:STDOUT: ret void, !dbg !147 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN1CC1Ev(ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1 @@ -671,9 +678,9 @@ fn F() { // CHECK:STDOUT: attributes #2 = { alwaysinline 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" } // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!132} -// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!24} +// CHECK:STDOUT: !llvm.dbg.cu = !{!133} +// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !20, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!25} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -682,30 +689,31 @@ fn F() { // CHECK:STDOUT: !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !11 = !{null, !8} // CHECK:STDOUT: !12 = !DISubroutineType(types: !11) -// CHECK:STDOUT: !17 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !18 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !19 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !20 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !21 = !{!"omnipotent char", !20, i64 0} -// CHECK:STDOUT: !22 = !{!"int", !21, i64 0} -// CHECK:STDOUT: !23 = !{!"__libc_errno", !22, i64 0} -// CHECK:STDOUT: !24 = !{!23, !22, i64 0} -// CHECK:STDOUT: !42 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") -// CHECK:STDOUT: !86 = !{!"any pointer", !21, i64 0} -// CHECK:STDOUT: !87 = !{!86, !86, i64 0} -// CHECK:STDOUT: !131 = !DIFile(filename: "call_complex_fn_ptr.carbon", directory: "") -// CHECK:STDOUT: !132 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !131, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !135 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !131, line: 5, type: !7, spFlags: DISPFlagDefinition, unit: !132) -// CHECK:STDOUT: !136 = !DILocation(line: 6, column: 3, scope: !135) -// CHECK:STDOUT: !137 = !DILocation(line: 6, column: 25, scope: !135) -// CHECK:STDOUT: !138 = !DILocation(line: 6, column: 50, scope: !135) -// CHECK:STDOUT: !140 = !DILocation(line: 5, column: 1, scope: !135) -// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.4d2f117a5a2332f0", scope: null, file: !42, line: 36, type: !12, spFlags: DISPFlagDefinition, unit: !132, retainedNodes: !147) -// CHECK:STDOUT: !142 = !DILocalVariable(arg: 1, scope: !141, type: !8) -// CHECK:STDOUT: !146 = !DILocation(line: 36, column: 1, scope: !141) -// CHECK:STDOUT: !147 = !{!142} -// CHECK:STDOUT: !148 = !{!"p1 _ZTS1C", !86, i64 0} -// CHECK:STDOUT: !149 = !{!148, !148, i64 0} +// CHECK:STDOUT: !17 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !18 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !19 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !20 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !21 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !22 = !{!"omnipotent char", !21, i64 0} +// CHECK:STDOUT: !23 = !{!"int", !22, i64 0} +// CHECK:STDOUT: !24 = !{!"__libc_errno", !23, i64 0} +// CHECK:STDOUT: !25 = !{!24, !23, i64 0} +// CHECK:STDOUT: !43 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") +// CHECK:STDOUT: !87 = !{!"any pointer", !22, i64 0} +// CHECK:STDOUT: !88 = !{!87, !87, i64 0} +// CHECK:STDOUT: !132 = !DIFile(filename: "call_complex_fn_ptr.carbon", directory: "") +// CHECK:STDOUT: !133 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !132, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !132, line: 5, type: !7, spFlags: DISPFlagDefinition, unit: !133) +// CHECK:STDOUT: !137 = !DILocation(line: 6, column: 3, scope: !136) +// CHECK:STDOUT: !138 = !DILocation(line: 6, column: 25, scope: !136) +// CHECK:STDOUT: !139 = !DILocation(line: 6, column: 50, scope: !136) +// CHECK:STDOUT: !141 = !DILocation(line: 5, column: 1, scope: !136) +// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.4d2f117a5a2332f0", scope: null, file: !43, line: 36, type: !12, spFlags: DISPFlagDefinition, unit: !133, retainedNodes: !148) +// CHECK:STDOUT: !143 = !DILocalVariable(arg: 1, scope: !142, type: !8) +// CHECK:STDOUT: !147 = !DILocation(line: 36, column: 1, scope: !142) +// CHECK:STDOUT: !148 = !{!143} +// CHECK:STDOUT: !149 = !{!"p1 _ZTS1C", !87, i64 0} +// CHECK:STDOUT: !150 = !{!149, !149, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'mention_forward_decl.carbon' @@ -714,14 +722,14 @@ fn F() { // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !153 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !154 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %callback.var = alloca ptr, align 8, !dbg !154 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %callback.var), !dbg !154 -// CHECK:STDOUT: %ReturnCallback.call = call ptr @_Z14ReturnCallbackv(), !dbg !155 -// CHECK:STDOUT: store ptr %ReturnCallback.call, ptr %callback.var, align 8, !dbg !154 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %callback.var), !dbg !154 -// CHECK:STDOUT: ret void, !dbg !157 +// CHECK:STDOUT: %callback.var = alloca ptr, align 8, !dbg !155 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %callback.var), !dbg !155 +// CHECK:STDOUT: %ReturnCallback.call = call ptr @_Z14ReturnCallbackv(), !dbg !156 +// CHECK:STDOUT: store ptr %ReturnCallback.call, ptr %callback.var, align 8, !dbg !155 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %callback.var), !dbg !155 +// CHECK:STDOUT: ret void, !dbg !158 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z14ReturnCallbackv() #1 @@ -730,17 +738,17 @@ fn F() { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %t) #0 !dbg !158 { -// CHECK:STDOUT: ret void, !dbg !163 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %t) #0 !dbg !159 { +// CHECK:STDOUT: ret void, !dbg !164 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!152} -// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!24} +// CHECK:STDOUT: !llvm.dbg.cu = !{!153} +// CHECK:STDOUT: !llvm.module.flags = !{!17, !18, !19, !20, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!25} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -749,23 +757,24 @@ fn F() { // CHECK:STDOUT: !8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !11 = !{null, !8} // CHECK:STDOUT: !12 = !DISubroutineType(types: !11) -// CHECK:STDOUT: !17 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !18 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !19 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !20 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !21 = !{!"omnipotent char", !20, i64 0} -// CHECK:STDOUT: !22 = !{!"int", !21, i64 0} -// CHECK:STDOUT: !23 = !{!"__libc_errno", !22, i64 0} -// CHECK:STDOUT: !24 = !{!23, !22, i64 0} -// CHECK:STDOUT: !42 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") -// CHECK:STDOUT: !151 = !DIFile(filename: "mention_forward_decl.carbon", directory: "") -// CHECK:STDOUT: !152 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !151, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !153 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !151, line: 5, type: !7, spFlags: DISPFlagDefinition, unit: !152) -// CHECK:STDOUT: !154 = !DILocation(line: 6, column: 3, scope: !153) -// CHECK:STDOUT: !155 = !DILocation(line: 6, column: 43, scope: !153) -// CHECK:STDOUT: !157 = !DILocation(line: 5, column: 1, scope: !153) -// CHECK:STDOUT: !158 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.9d0db8a57c58fabc", scope: null, file: !42, line: 36, type: !12, spFlags: DISPFlagDefinition, unit: !152, retainedNodes: !164) -// CHECK:STDOUT: !159 = !DILocalVariable(arg: 1, scope: !158, type: !8) -// CHECK:STDOUT: !163 = !DILocation(line: 36, column: 1, scope: !158) -// CHECK:STDOUT: !164 = !{!159} +// CHECK:STDOUT: !17 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !18 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !19 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !20 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !21 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !22 = !{!"omnipotent char", !21, i64 0} +// CHECK:STDOUT: !23 = !{!"int", !22, i64 0} +// CHECK:STDOUT: !24 = !{!"__libc_errno", !23, i64 0} +// CHECK:STDOUT: !25 = !{!24, !23, i64 0} +// CHECK:STDOUT: !43 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") +// CHECK:STDOUT: !152 = !DIFile(filename: "mention_forward_decl.carbon", directory: "") +// CHECK:STDOUT: !153 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !152, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !152, line: 5, type: !7, spFlags: DISPFlagDefinition, unit: !153) +// CHECK:STDOUT: !155 = !DILocation(line: 6, column: 3, scope: !154) +// CHECK:STDOUT: !156 = !DILocation(line: 6, column: 43, scope: !154) +// CHECK:STDOUT: !158 = !DILocation(line: 5, column: 1, scope: !154) +// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.9d0db8a57c58fabc", scope: null, file: !43, line: 36, type: !12, spFlags: DISPFlagDefinition, unit: !153, retainedNodes: !165) +// CHECK:STDOUT: !160 = !DILocalVariable(arg: 1, scope: !159, type: !8) +// CHECK:STDOUT: !164 = !DILocation(line: 36, column: 1, scope: !159) +// CHECK:STDOUT: !165 = !{!160} // 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 3616671ce8bd..838fea9d175b 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon @@ -65,8 +65,8 @@ fn Call() -> i32 { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!26} -// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !9, !10} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!56} +// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !55, !9, !10} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -94,9 +94,10 @@ fn Call() -> i32 { // CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !27) // CHECK:STDOUT: !50 = !DILocation(line: 32, column: 1, scope: !45) // CHECK:STDOUT: !51 = !{!46} -// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !55 = !{!"__libc_errno", !2, i64 0} -// CHECK:STDOUT: !56 = !{!55, !2, i64 0} +// CHECK:STDOUT: !52 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !2, i64 0} +// CHECK:STDOUT: !57 = !{!56, !2, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/function/import/method_ptr.carbon b/toolchain/lower/testdata/interop/cpp/function/import/method_ptr.carbon index f3e115c90b08..335e9ac3bb3e 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/method_ptr.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/method_ptr.carbon @@ -135,8 +135,8 @@ fn F() { // CHECK:STDOUT: attributes #3 = { "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!28, !29, !30, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} +// CHECK:STDOUT: !llvm.module.flags = !{!28, !29, !30, !31, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!34} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -161,12 +161,13 @@ fn F() { // CHECK:STDOUT: !25 = !{!"any pointer", !24, i64 0} // CHECK:STDOUT: !26 = !{!25, !25, i64 0} // CHECK:STDOUT: !27 = !{!24, !24, i64 0} -// CHECK:STDOUT: !28 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !29 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !30 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !31 = !{!"int", !24, i64 0} -// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} -// CHECK:STDOUT: !33 = !{!32, !31, i64 0} +// CHECK:STDOUT: !28 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !29 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !30 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !31 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !32 = !{!"int", !24, i64 0} +// CHECK:STDOUT: !33 = !{!"__libc_errno", !32, i64 0} +// CHECK:STDOUT: !34 = !{!33, !32, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'convert_method_ptr.carbon' @@ -177,40 +178,40 @@ fn F() { // CHECK:STDOUT: declare void @_CMethod.C.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !36 { +// CHECK:STDOUT: define void @_CG.Main() #0 !dbg !37 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ptr.var = alloca ptr, align 8, !dbg !37 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr.var), !dbg !37 -// CHECK:STDOUT: store ptr @_CMethod.C.Main, ptr %ptr.var, align 8, !dbg !37 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %ptr.var), !dbg !37 -// CHECK:STDOUT: ret void, !dbg !39 +// CHECK:STDOUT: %ptr.var = alloca ptr, align 8, !dbg !38 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %ptr.var), !dbg !38 +// CHECK:STDOUT: store ptr @_CMethod.C.Main, ptr %ptr.var, align 8, !dbg !38 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %ptr.var), !dbg !38 +// CHECK:STDOUT: ret void, !dbg !40 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #1 !dbg !40 { +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #1 !dbg !41 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CSelfDestruct.Core.356af3b6aef18564(ptr %self), !dbg !42 -// CHECK:STDOUT: ret void, !dbg !42 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.356af3b6aef18564(ptr %self), !dbg !43 +// CHECK:STDOUT: ret void, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CMethod__carbon_thunk.C.Main(ptr noundef nonnull align 1 %self) #2 !dbg !44 { +// CHECK:STDOUT: define linkonce_odr void @_CMethod__carbon_thunk.C.Main(ptr noundef nonnull align 1 %self) #2 !dbg !45 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CMethod.C.Main(ptr %self), !dbg !47 -// CHECK:STDOUT: ret void, !dbg !47 +// CHECK:STDOUT: call void @_CMethod.C.Main(ptr %self), !dbg !48 +// CHECK:STDOUT: ret void, !dbg !48 // 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 @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %t) #0 !dbg !49 { -// CHECK:STDOUT: ret void, !dbg !54 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %t) #0 !dbg !50 { +// CHECK:STDOUT: ret void, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.356af3b6aef18564(ptr %t) #0 !dbg !56 { -// CHECK:STDOUT: ret void, !dbg !61 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.356af3b6aef18564(ptr %t) #0 !dbg !57 { +// CHECK:STDOUT: ret void, !dbg !62 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } @@ -218,9 +219,9 @@ fn F() { // CHECK:STDOUT: attributes #2 = { nounwind "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" } // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!35} -// CHECK:STDOUT: !llvm.module.flags = !{!28, !29, !30, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} +// CHECK:STDOUT: !llvm.dbg.cu = !{!36} +// CHECK:STDOUT: !llvm.module.flags = !{!28, !29, !30, !31, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!34} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -232,33 +233,34 @@ fn F() { // CHECK:STDOUT: !15 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") // CHECK:STDOUT: !23 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !24 = !{!"omnipotent char", !23, i64 0} -// CHECK:STDOUT: !28 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !29 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !30 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !31 = !{!"int", !24, i64 0} -// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} -// CHECK:STDOUT: !33 = !{!32, !31, i64 0} -// CHECK:STDOUT: !34 = !DIFile(filename: "convert_method_ptr.carbon", directory: "") -// CHECK:STDOUT: !35 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !34, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !34, line: 13, type: !7, spFlags: DISPFlagDefinition, unit: !35) -// CHECK:STDOUT: !37 = !DILocation(line: 14, column: 3, scope: !36) -// CHECK:STDOUT: !39 = !DILocation(line: 13, column: 1, scope: !36) -// CHECK:STDOUT: !40 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !34, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !35, retainedNodes: !43) -// CHECK:STDOUT: !41 = !DILocalVariable(arg: 1, scope: !40, type: !8) -// CHECK:STDOUT: !42 = !DILocation(line: 5, column: 1, scope: !40) -// CHECK:STDOUT: !43 = !{!41} -// CHECK:STDOUT: !44 = distinct !DISubprogram(name: "Method__carbon_thunk", linkageName: "_CMethod__carbon_thunk.C.Main", scope: null, file: !34, line: 14, type: !10, spFlags: DISPFlagDefinition, unit: !35, retainedNodes: !48) -// CHECK:STDOUT: !45 = !DILocalVariable(arg: 1, scope: !44, type: !8) -// CHECK:STDOUT: !47 = !DILocation(line: 6, column: 3, scope: !44) -// CHECK:STDOUT: !48 = !{!45} -// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.9d0db8a57c58fabc", scope: null, file: !15, line: 36, type: !10, spFlags: DISPFlagDefinition, unit: !35, retainedNodes: !55) -// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !8) -// CHECK:STDOUT: !54 = !DILocation(line: 36, column: 1, scope: !49) -// CHECK:STDOUT: !55 = !{!50} -// CHECK:STDOUT: !56 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.356af3b6aef18564", scope: null, file: !15, line: 36, type: !10, spFlags: DISPFlagDefinition, unit: !35, retainedNodes: !62) -// CHECK:STDOUT: !57 = !DILocalVariable(arg: 1, scope: !56, type: !8) -// CHECK:STDOUT: !61 = !DILocation(line: 36, column: 1, scope: !56) -// CHECK:STDOUT: !62 = !{!57} +// CHECK:STDOUT: !28 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !29 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !30 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !31 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !32 = !{!"int", !24, i64 0} +// CHECK:STDOUT: !33 = !{!"__libc_errno", !32, i64 0} +// CHECK:STDOUT: !34 = !{!33, !32, i64 0} +// CHECK:STDOUT: !35 = !DIFile(filename: "convert_method_ptr.carbon", directory: "") +// CHECK:STDOUT: !36 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !35, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !37 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !35, line: 13, type: !7, spFlags: DISPFlagDefinition, unit: !36) +// CHECK:STDOUT: !38 = !DILocation(line: 14, column: 3, scope: !37) +// CHECK:STDOUT: !40 = !DILocation(line: 13, column: 1, scope: !37) +// CHECK:STDOUT: !41 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !35, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !36, retainedNodes: !44) +// CHECK:STDOUT: !42 = !DILocalVariable(arg: 1, scope: !41, type: !8) +// CHECK:STDOUT: !43 = !DILocation(line: 5, column: 1, scope: !41) +// CHECK:STDOUT: !44 = !{!42} +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "Method__carbon_thunk", linkageName: "_CMethod__carbon_thunk.C.Main", scope: null, file: !35, line: 14, type: !10, spFlags: DISPFlagDefinition, unit: !36, retainedNodes: !49) +// CHECK:STDOUT: !46 = !DILocalVariable(arg: 1, scope: !45, type: !8) +// CHECK:STDOUT: !48 = !DILocation(line: 6, column: 3, scope: !45) +// CHECK:STDOUT: !49 = !{!46} +// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.9d0db8a57c58fabc", scope: null, file: !15, line: 36, type: !10, spFlags: DISPFlagDefinition, unit: !36, retainedNodes: !56) +// CHECK:STDOUT: !51 = !DILocalVariable(arg: 1, scope: !50, type: !8) +// CHECK:STDOUT: !55 = !DILocation(line: 36, column: 1, scope: !50) +// CHECK:STDOUT: !56 = !{!51} +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.356af3b6aef18564", scope: null, file: !15, line: 36, type: !10, spFlags: DISPFlagDefinition, unit: !36, retainedNodes: !63) +// CHECK:STDOUT: !58 = !DILocalVariable(arg: 1, scope: !57, type: !8) +// CHECK:STDOUT: !62 = !DILocation(line: 36, column: 1, scope: !57) +// CHECK:STDOUT: !63 = !{!58} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'pass_method_ptr.carbon' @@ -271,27 +273,27 @@ fn F() { // CHECK:STDOUT: declare void @_CMethod.C.Main(ptr) // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !65 { +// CHECK:STDOUT: define void @_CF.Main() #0 !dbg !66 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc10_29.3.temp = alloca ptr, align 8, !dbg !66 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc10_29.3.temp), !dbg !66 -// CHECK:STDOUT: call void @_Z20TakeGenericMethodPtrIN6Carbon4Main1CEEvMT_KFvvE.carbon_thunk._(ptr @.b35), !dbg !67 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr @.b35), !dbg !66 -// CHECK:STDOUT: ret void, !dbg !68 +// CHECK:STDOUT: %.loc10_29.3.temp = alloca ptr, align 8, !dbg !67 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc10_29.3.temp), !dbg !67 +// CHECK:STDOUT: call void @_Z20TakeGenericMethodPtrIN6Carbon4Main1CEEvMT_KFvvE.carbon_thunk._(ptr @.b35), !dbg !68 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr @.b35), !dbg !67 +// CHECK:STDOUT: ret void, !dbg !69 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #1 !dbg !69 { +// CHECK:STDOUT: define weak_odr void @"_C__destroy_thunk:thunk.C.Main"(ptr %self) #1 !dbg !70 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CSelfDestruct.Core.356af3b6aef18564(ptr %self), !dbg !71 -// CHECK:STDOUT: ret void, !dbg !71 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.356af3b6aef18564(ptr %self), !dbg !72 +// CHECK:STDOUT: ret void, !dbg !72 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CMethod__carbon_thunk.C.Main(ptr noundef nonnull align 1 %self) #2 !dbg !73 { +// CHECK:STDOUT: define linkonce_odr void @_CMethod__carbon_thunk.C.Main(ptr noundef nonnull align 1 %self) #2 !dbg !74 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CMethod.C.Main(ptr %self), !dbg !75 -// CHECK:STDOUT: ret void, !dbg !75 +// CHECK:STDOUT: call void @_CMethod.C.Main(ptr %self), !dbg !76 +// CHECK:STDOUT: ret void, !dbg !76 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -315,13 +317,13 @@ fn F() { // 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 @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %t) #0 !dbg !77 { -// CHECK:STDOUT: ret void, !dbg !82 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.9d0db8a57c58fabc(ptr %t) #0 !dbg !78 { +// CHECK:STDOUT: ret void, !dbg !83 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.356af3b6aef18564(ptr %t) #0 !dbg !84 { -// CHECK:STDOUT: ret void, !dbg !89 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.356af3b6aef18564(ptr %t) #0 !dbg !85 { +// CHECK:STDOUT: ret void, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z20TakeGenericMethodPtrIN6Carbon4Main1CEEvMT_KFvvE(i64, i64) #5 @@ -333,9 +335,9 @@ fn F() { // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #5 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!64} -// CHECK:STDOUT: !llvm.module.flags = !{!28, !29, !30, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!33} +// CHECK:STDOUT: !llvm.dbg.cu = !{!65} +// CHECK:STDOUT: !llvm.module.flags = !{!28, !29, !30, !31, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!34} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -350,32 +352,33 @@ fn F() { // CHECK:STDOUT: !25 = !{!"any pointer", !24, i64 0} // CHECK:STDOUT: !26 = !{!25, !25, i64 0} // CHECK:STDOUT: !27 = !{!24, !24, i64 0} -// CHECK:STDOUT: !28 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !29 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !30 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !31 = !{!"int", !24, i64 0} -// CHECK:STDOUT: !32 = !{!"__libc_errno", !31, i64 0} -// CHECK:STDOUT: !33 = !{!32, !31, i64 0} -// CHECK:STDOUT: !63 = !DIFile(filename: "pass_method_ptr.carbon", directory: "") -// CHECK:STDOUT: !64 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !63, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !65 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !63, line: 9, type: !7, spFlags: DISPFlagDefinition, unit: !64) -// CHECK:STDOUT: !66 = !DILocation(line: 10, column: 28, scope: !65) -// CHECK:STDOUT: !67 = !DILocation(line: 10, column: 3, scope: !65) -// CHECK:STDOUT: !68 = !DILocation(line: 9, column: 1, scope: !65) -// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !63, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !64, retainedNodes: !72) -// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !8) -// CHECK:STDOUT: !71 = !DILocation(line: 5, column: 1, scope: !69) -// CHECK:STDOUT: !72 = !{!70} -// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Method__carbon_thunk", linkageName: "_CMethod__carbon_thunk.C.Main", scope: null, file: !63, line: 6, type: !10, spFlags: DISPFlagDefinition, unit: !64, retainedNodes: !76) -// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !8) -// CHECK:STDOUT: !75 = !DILocation(line: 6, column: 3, scope: !73) -// CHECK:STDOUT: !76 = !{!74} -// CHECK:STDOUT: !77 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.9d0db8a57c58fabc", scope: null, file: !15, line: 36, type: !10, spFlags: DISPFlagDefinition, unit: !64, retainedNodes: !83) -// CHECK:STDOUT: !78 = !DILocalVariable(arg: 1, scope: !77, type: !8) -// CHECK:STDOUT: !82 = !DILocation(line: 36, column: 1, scope: !77) -// CHECK:STDOUT: !83 = !{!78} -// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.356af3b6aef18564", scope: null, file: !15, line: 36, type: !10, spFlags: DISPFlagDefinition, unit: !64, retainedNodes: !90) -// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !8) -// CHECK:STDOUT: !89 = !DILocation(line: 36, column: 1, scope: !84) -// CHECK:STDOUT: !90 = !{!85} +// CHECK:STDOUT: !28 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !29 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !30 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !31 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !32 = !{!"int", !24, i64 0} +// CHECK:STDOUT: !33 = !{!"__libc_errno", !32, i64 0} +// CHECK:STDOUT: !34 = !{!33, !32, i64 0} +// CHECK:STDOUT: !64 = !DIFile(filename: "pass_method_ptr.carbon", directory: "") +// CHECK:STDOUT: !65 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !64, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !66 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !64, line: 9, type: !7, spFlags: DISPFlagDefinition, unit: !65) +// CHECK:STDOUT: !67 = !DILocation(line: 10, column: 28, scope: !66) +// CHECK:STDOUT: !68 = !DILocation(line: 10, column: 3, scope: !66) +// CHECK:STDOUT: !69 = !DILocation(line: 9, column: 1, scope: !66) +// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "__destroy_thunk", linkageName: "_C__destroy_thunk:thunk.C.Main", scope: null, file: !64, line: 5, type: !10, spFlags: DISPFlagDefinition, unit: !65, retainedNodes: !73) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 1, scope: !70, type: !8) +// CHECK:STDOUT: !72 = !DILocation(line: 5, column: 1, scope: !70) +// CHECK:STDOUT: !73 = !{!71} +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "Method__carbon_thunk", linkageName: "_CMethod__carbon_thunk.C.Main", scope: null, file: !64, line: 6, type: !10, spFlags: DISPFlagDefinition, unit: !65, retainedNodes: !77) +// CHECK:STDOUT: !75 = !DILocalVariable(arg: 1, scope: !74, type: !8) +// CHECK:STDOUT: !76 = !DILocation(line: 6, column: 3, scope: !74) +// CHECK:STDOUT: !77 = !{!75} +// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.9d0db8a57c58fabc", scope: null, file: !15, line: 36, type: !10, spFlags: DISPFlagDefinition, unit: !65, retainedNodes: !84) +// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !8) +// CHECK:STDOUT: !83 = !DILocation(line: 36, column: 1, scope: !78) +// CHECK:STDOUT: !84 = !{!79} +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.356af3b6aef18564", scope: null, file: !15, line: 36, type: !10, spFlags: DISPFlagDefinition, unit: !65, retainedNodes: !91) +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !8) +// CHECK:STDOUT: !90 = !DILocation(line: 36, column: 1, scope: !85) +// CHECK:STDOUT: !91 = !{!86} // 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 00c7f72cdc80..4bdfb10048d2 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon @@ -272,8 +272,8 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: attributes #3 = { "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!35} -// CHECK:STDOUT: !llvm.module.flags = !{!132, !133, !134, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!136} +// CHECK:STDOUT: !llvm.module.flags = !{!132, !133, !134, !135, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!137} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -351,11 +351,12 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: !129 = !{!128, !128, i64 0} // CHECK:STDOUT: !130 = !{!119, !119, i64 0} // CHECK:STDOUT: !131 = !{!123, !123, i64 0} -// CHECK:STDOUT: !132 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !133 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !134 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !135 = !{!"__libc_errno", !126, i64 0} -// CHECK:STDOUT: !136 = !{!135, !126, i64 0} +// CHECK:STDOUT: !132 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !133 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !134 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !135 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !136 = !{!"__libc_errno", !126, i64 0} +// CHECK:STDOUT: !137 = !{!136, !126, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_struct.carbon' @@ -366,36 +367,36 @@ 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 !141 { +// CHECK:STDOUT: define void @_CTest.Main() #0 !dbg !142 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %x.var = alloca [12 x i8], align 4, !dbg !142 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !142 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr %x.var), !dbg !142 -// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 0, !dbg !144 -// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !144 -// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 4, !dbg !145 -// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !145 -// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 8, !dbg !146 -// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !146 -// CHECK:STDOUT: call void @_Z11pass_struct1X.carbon_thunk._(ptr %x.var), !dbg !148 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr %x.var), !dbg !142 -// CHECK:STDOUT: ret void, !dbg !149 +// CHECK:STDOUT: %x.var = alloca [12 x i8], align 4, !dbg !143 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %x.var), !dbg !143 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr %x.var), !dbg !143 +// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 0, !dbg !145 +// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !145 +// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 4, !dbg !146 +// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !146 +// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %x.var, i32 0, i32 8, !dbg !147 +// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !147 +// CHECK:STDOUT: call void @_Z11pass_struct1X.carbon_thunk._(ptr %x.var), !dbg !149 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr %x.var), !dbg !143 +// CHECK:STDOUT: ret void, !dbg !150 // 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 !166 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !166 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !167 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !167 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr sret([12 x i8]) %return) #2 !dbg !151 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr sret([12 x i8]) %return) #2 !dbg !152 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %return), !dbg !152 -// CHECK:STDOUT: ret void, !dbg !152 +// CHECK:STDOUT: call void @_ZN1XC1Ev.carbon_thunk.(ptr %return), !dbg !153 +// CHECK:STDOUT: ret void, !dbg !153 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -404,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 !166 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !166 -// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 12, i1 false), !tbaa.struct !168 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !167 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !167 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 12, i1 false), !tbaa.struct !169 // 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 @@ -420,14 +421,14 @@ 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 !153 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr %return), !dbg !156 -// CHECK:STDOUT: ret void, !dbg !157 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1"(ptr sret([12 x i8]) %return) #0 !dbg !154 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp"(ptr %return), !dbg !157 +// CHECK:STDOUT: ret void, !dbg !158 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr %t) #0 !dbg !158 { -// CHECK:STDOUT: ret void, !dbg !163 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr %t) #0 !dbg !159 { +// CHECK:STDOUT: ret void, !dbg !164 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z11pass_struct1X(i64, i32) #5 @@ -445,9 +446,9 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #5 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!138} -// CHECK:STDOUT: !llvm.module.flags = !{!132, !133, !134, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!136} +// CHECK:STDOUT: !llvm.dbg.cu = !{!139} +// CHECK:STDOUT: !llvm.module.flags = !{!132, !133, !134, !135, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!137} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -463,35 +464,36 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: !120 = !{!"any pointer", !119, i64 0} // CHECK:STDOUT: !126 = !{!"int", !119, i64 0} // CHECK:STDOUT: !127 = !{!126, !126, i64 0} -// CHECK:STDOUT: !132 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !133 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !134 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !135 = !{!"__libc_errno", !126, i64 0} -// CHECK:STDOUT: !136 = !{!135, !126, i64 0} -// CHECK:STDOUT: !137 = !DIFile(filename: "import_struct.carbon", directory: "") -// CHECK:STDOUT: !138 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !137, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !139 = !{!44} -// CHECK:STDOUT: !140 = !DISubroutineType(types: !139) -// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !137, line: 6, type: !43, spFlags: DISPFlagDefinition, unit: !138) -// CHECK:STDOUT: !142 = !DILocation(line: 7, column: 3, scope: !141) -// CHECK:STDOUT: !144 = !DILocation(line: 8, column: 3, scope: !141) -// CHECK:STDOUT: !145 = !DILocation(line: 9, column: 3, scope: !141) -// CHECK:STDOUT: !146 = !DILocation(line: 10, column: 3, scope: !141) -// CHECK:STDOUT: !148 = !DILocation(line: 11, column: 3, scope: !141) -// CHECK:STDOUT: !149 = !DILocation(line: 6, column: 1, scope: !141) -// CHECK:STDOUT: !150 = !DIFile(filename: "./struct.h", directory: "") -// CHECK:STDOUT: !151 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp", scope: null, file: !150, line: 2, type: !140, spFlags: DISPFlagDefinition, unit: !138) -// CHECK:STDOUT: !152 = !DILocation(line: 2, column: 8, scope: !151) -// CHECK:STDOUT: !153 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1", scope: null, file: !22, line: 9, type: !140, spFlags: DISPFlagDefinition, unit: !138) -// CHECK:STDOUT: !156 = !DILocation(line: 9, column: 28, scope: !153) -// CHECK:STDOUT: !157 = !DILocation(line: 9, column: 21, scope: !153) -// CHECK:STDOUT: !158 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.2d682b12c0c20e08", scope: null, file: !26, line: 32, type: !54, spFlags: DISPFlagDefinition, unit: !138, retainedNodes: !164) -// CHECK:STDOUT: !159 = !DILocalVariable(arg: 1, scope: !158, type: !44) -// CHECK:STDOUT: !163 = !DILocation(line: 32, column: 1, scope: !158) -// CHECK:STDOUT: !164 = !{!159} -// CHECK:STDOUT: !165 = !{!"p1 _ZTS1X", !120, i64 0} -// CHECK:STDOUT: !166 = !{!165, !165, i64 0} -// CHECK:STDOUT: !168 = !{i64 0, i64 4, !127, i64 4, i64 4, !127, i64 8, i64 4, !127} +// CHECK:STDOUT: !132 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !133 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !134 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !135 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !136 = !{!"__libc_errno", !126, i64 0} +// CHECK:STDOUT: !137 = !{!136, !126, i64 0} +// CHECK:STDOUT: !138 = !DIFile(filename: "import_struct.carbon", directory: "") +// CHECK:STDOUT: !139 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !138, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !140 = !{!44} +// CHECK:STDOUT: !141 = !DISubroutineType(types: !140) +// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !138, line: 6, type: !43, spFlags: DISPFlagDefinition, unit: !139) +// CHECK:STDOUT: !143 = !DILocation(line: 7, column: 3, scope: !142) +// CHECK:STDOUT: !145 = !DILocation(line: 8, column: 3, scope: !142) +// CHECK:STDOUT: !146 = !DILocation(line: 9, column: 3, scope: !142) +// CHECK:STDOUT: !147 = !DILocation(line: 10, column: 3, scope: !142) +// CHECK:STDOUT: !149 = !DILocation(line: 11, column: 3, scope: !142) +// CHECK:STDOUT: !150 = !DILocation(line: 6, column: 1, scope: !142) +// CHECK:STDOUT: !151 = !DIFile(filename: "./struct.h", directory: "") +// CHECK:STDOUT: !152 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.eed9ddf3aaac414a.Core:X.Cpp", scope: null, file: !151, line: 2, type: !141, spFlags: DISPFlagDefinition, unit: !139) +// CHECK:STDOUT: !153 = !DILocation(line: 2, column: 8, scope: !152) +// CHECK:STDOUT: !154 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.102476b7ae87d0a1", scope: null, file: !22, line: 9, type: !141, spFlags: DISPFlagDefinition, unit: !139) +// CHECK:STDOUT: !157 = !DILocation(line: 9, column: 28, scope: !154) +// CHECK:STDOUT: !158 = !DILocation(line: 9, column: 21, scope: !154) +// CHECK:STDOUT: !159 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.2d682b12c0c20e08", scope: null, file: !26, line: 32, type: !54, spFlags: DISPFlagDefinition, unit: !139, retainedNodes: !165) +// CHECK:STDOUT: !160 = !DILocalVariable(arg: 1, scope: !159, type: !44) +// CHECK:STDOUT: !164 = !DILocation(line: 32, column: 1, scope: !159) +// CHECK:STDOUT: !165 = !{!160} +// CHECK:STDOUT: !166 = !{!"p1 _ZTS1X", !120, i64 0} +// CHECK:STDOUT: !167 = !{!166, !166, i64 0} +// CHECK:STDOUT: !169 = !{i64 0, i64 4, !127, i64 4, i64 4, !127, i64 8, i64 4, !127} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_class_with_nontrivial_copy.carbon' @@ -502,19 +504,19 @@ 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 !171 { +// CHECK:STDOUT: define void @_CPassRefExpr.Main() #0 !dbg !172 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %y.var = alloca [12 x i8], align 4, !dbg !172 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !172 -// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 0, !dbg !174 -// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !174 -// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 4, !dbg !175 -// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !175 -// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 8, !dbg !176 -// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !176 -// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y.var), !dbg !178 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.5d1f4d5634dc3faa(ptr %y.var), !dbg !172 -// CHECK:STDOUT: ret void, !dbg !179 +// CHECK:STDOUT: %y.var = alloca [12 x i8], align 4, !dbg !173 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %y.var), !dbg !173 +// CHECK:STDOUT: %.loc8_4.a = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 0, !dbg !175 +// CHECK:STDOUT: store i32 1, ptr %.loc8_4.a, align 4, !dbg !175 +// CHECK:STDOUT: %.loc9_4.b = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 4, !dbg !176 +// CHECK:STDOUT: store i32 2, ptr %.loc9_4.b, align 4, !dbg !176 +// CHECK:STDOUT: %.loc10_4.c = getelementptr inbounds nuw [12 x i8], ptr %y.var, i32 0, i32 8, !dbg !177 +// CHECK:STDOUT: store i32 3, ptr %.loc10_4.c, align 4, !dbg !177 +// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y.var), !dbg !179 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.5d1f4d5634dc3faa(ptr %y.var), !dbg !173 +// CHECK:STDOUT: ret void, !dbg !180 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -522,8 +524,8 @@ 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 !199 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !199 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !200 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !200 // 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 nofreeobj noundef align 4 dead_on_return dereferenceable(12) %agg.tmp) // CHECK:STDOUT: ret void @@ -532,29 +534,29 @@ fn PassValueExpr(y: Cpp.Y) { // 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 !180 { +// CHECK:STDOUT: define void @_CPassInitExpr.Main() #0 !dbg !181 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc17_24.1.temp = alloca [12 x i8], align 4, !dbg !181 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_24.1.temp), !dbg !181 -// CHECK:STDOUT: call void @_CMake.Main(ptr %.loc17_24.1.temp), !dbg !181 -// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %.loc17_24.1.temp), !dbg !182 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.5d1f4d5634dc3faa(ptr %.loc17_24.1.temp), !dbg !181 -// CHECK:STDOUT: ret void, !dbg !183 +// CHECK:STDOUT: %.loc17_24.1.temp = alloca [12 x i8], align 4, !dbg !182 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc17_24.1.temp), !dbg !182 +// CHECK:STDOUT: call void @_CMake.Main(ptr %.loc17_24.1.temp), !dbg !182 +// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %.loc17_24.1.temp), !dbg !183 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.5d1f4d5634dc3faa(ptr %.loc17_24.1.temp), !dbg !182 +// CHECK:STDOUT: ret void, !dbg !184 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassValueExpr.Main(ptr %y) #0 !dbg !184 { +// CHECK:STDOUT: define void @_CPassValueExpr.Main(ptr %y) #0 !dbg !185 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y), !dbg !188 -// CHECK:STDOUT: ret void, !dbg !189 +// CHECK:STDOUT: call void @_Z11pass_struct1Y.carbon_thunk._(ptr %y), !dbg !189 +// CHECK:STDOUT: ret void, !dbg !190 // 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 void @_CSelfDestruct.Core.5d1f4d5634dc3faa(ptr %t) #0 !dbg !191 { -// CHECK:STDOUT: ret void, !dbg !196 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.5d1f4d5634dc3faa(ptr %t) #0 !dbg !192 { +// CHECK:STDOUT: ret void, !dbg !197 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z11pass_struct1Y(ptr nofreeobj noundef align 4 dead_on_return dereferenceable(12)) #3 @@ -570,9 +572,9 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!170} -// CHECK:STDOUT: !llvm.module.flags = !{!132, !133, !134, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!136} +// CHECK:STDOUT: !llvm.dbg.cu = !{!171} +// CHECK:STDOUT: !llvm.module.flags = !{!132, !133, !134, !135, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!137} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -586,33 +588,34 @@ fn PassValueExpr(y: Cpp.Y) { // CHECK:STDOUT: !119 = !{!"omnipotent char", !118, i64 0} // CHECK:STDOUT: !120 = !{!"any pointer", !119, i64 0} // CHECK:STDOUT: !126 = !{!"int", !119, i64 0} -// CHECK:STDOUT: !132 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !133 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !134 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !135 = !{!"__libc_errno", !126, i64 0} -// CHECK:STDOUT: !136 = !{!135, !126, i64 0} -// CHECK:STDOUT: !169 = !DIFile(filename: "import_class_with_nontrivial_copy.carbon", directory: "") -// CHECK:STDOUT: !170 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !169, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "PassRefExpr", linkageName: "_CPassRefExpr.Main", scope: null, file: !169, line: 6, type: !43, spFlags: DISPFlagDefinition, unit: !170) -// CHECK:STDOUT: !172 = !DILocation(line: 7, column: 3, scope: !171) -// CHECK:STDOUT: !174 = !DILocation(line: 8, column: 3, scope: !171) -// CHECK:STDOUT: !175 = !DILocation(line: 9, column: 3, scope: !171) -// CHECK:STDOUT: !176 = !DILocation(line: 10, column: 3, scope: !171) -// CHECK:STDOUT: !178 = !DILocation(line: 11, column: 3, scope: !171) -// CHECK:STDOUT: !179 = !DILocation(line: 6, column: 1, scope: !171) -// CHECK:STDOUT: !180 = distinct !DISubprogram(name: "PassInitExpr", linkageName: "_CPassInitExpr.Main", scope: null, file: !169, line: 16, type: !43, spFlags: DISPFlagDefinition, unit: !170) -// CHECK:STDOUT: !181 = !DILocation(line: 17, column: 19, scope: !180) -// CHECK:STDOUT: !182 = !DILocation(line: 17, column: 3, scope: !180) -// CHECK:STDOUT: !183 = !DILocation(line: 16, column: 1, scope: !180) -// CHECK:STDOUT: !184 = distinct !DISubprogram(name: "PassValueExpr", linkageName: "_CPassValueExpr.Main", scope: null, file: !169, line: 20, type: !54, spFlags: DISPFlagDefinition, unit: !170, retainedNodes: !190) -// CHECK:STDOUT: !185 = !DILocalVariable(arg: 1, scope: !184, type: !44) -// CHECK:STDOUT: !188 = !DILocation(line: 21, column: 3, scope: !184) -// CHECK:STDOUT: !189 = !DILocation(line: 20, column: 1, scope: !184) -// CHECK:STDOUT: !190 = !{!185} -// CHECK:STDOUT: !191 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.5d1f4d5634dc3faa", scope: null, file: !26, line: 32, type: !54, spFlags: DISPFlagDefinition, unit: !170, retainedNodes: !197) -// CHECK:STDOUT: !192 = !DILocalVariable(arg: 1, scope: !191, type: !44) -// CHECK:STDOUT: !196 = !DILocation(line: 32, column: 1, scope: !191) -// CHECK:STDOUT: !197 = !{!192} -// CHECK:STDOUT: !198 = !{!"p1 _ZTS1Y", !120, i64 0} -// CHECK:STDOUT: !199 = !{!198, !198, i64 0} +// CHECK:STDOUT: !132 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !133 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !134 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !135 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !136 = !{!"__libc_errno", !126, i64 0} +// CHECK:STDOUT: !137 = !{!136, !126, i64 0} +// CHECK:STDOUT: !170 = !DIFile(filename: "import_class_with_nontrivial_copy.carbon", directory: "") +// CHECK:STDOUT: !171 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !170, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !172 = distinct !DISubprogram(name: "PassRefExpr", linkageName: "_CPassRefExpr.Main", scope: null, file: !170, line: 6, type: !43, spFlags: DISPFlagDefinition, unit: !171) +// CHECK:STDOUT: !173 = !DILocation(line: 7, column: 3, scope: !172) +// CHECK:STDOUT: !175 = !DILocation(line: 8, column: 3, scope: !172) +// CHECK:STDOUT: !176 = !DILocation(line: 9, column: 3, scope: !172) +// CHECK:STDOUT: !177 = !DILocation(line: 10, column: 3, scope: !172) +// CHECK:STDOUT: !179 = !DILocation(line: 11, column: 3, scope: !172) +// CHECK:STDOUT: !180 = !DILocation(line: 6, column: 1, scope: !172) +// CHECK:STDOUT: !181 = distinct !DISubprogram(name: "PassInitExpr", linkageName: "_CPassInitExpr.Main", scope: null, file: !170, line: 16, type: !43, spFlags: DISPFlagDefinition, unit: !171) +// CHECK:STDOUT: !182 = !DILocation(line: 17, column: 19, scope: !181) +// CHECK:STDOUT: !183 = !DILocation(line: 17, column: 3, scope: !181) +// CHECK:STDOUT: !184 = !DILocation(line: 16, column: 1, scope: !181) +// CHECK:STDOUT: !185 = distinct !DISubprogram(name: "PassValueExpr", linkageName: "_CPassValueExpr.Main", scope: null, file: !170, line: 20, type: !54, spFlags: DISPFlagDefinition, unit: !171, retainedNodes: !191) +// CHECK:STDOUT: !186 = !DILocalVariable(arg: 1, scope: !185, type: !44) +// CHECK:STDOUT: !189 = !DILocation(line: 21, column: 3, scope: !185) +// CHECK:STDOUT: !190 = !DILocation(line: 20, column: 1, scope: !185) +// CHECK:STDOUT: !191 = !{!186} +// CHECK:STDOUT: !192 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.5d1f4d5634dc3faa", scope: null, file: !26, line: 32, type: !54, spFlags: DISPFlagDefinition, unit: !171, retainedNodes: !198) +// CHECK:STDOUT: !193 = !DILocalVariable(arg: 1, scope: !192, type: !44) +// CHECK:STDOUT: !197 = !DILocation(line: 32, column: 1, scope: !192) +// CHECK:STDOUT: !198 = !{!193} +// CHECK:STDOUT: !199 = !{!"p1 _ZTS1Y", !120, i64 0} +// CHECK:STDOUT: !200 = !{!199, !199, i64 0} // 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 c21e6d97d932..973d8dd67c16 100644 --- a/toolchain/lower/testdata/interop/cpp/function/import/return.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/return.carbon @@ -134,7 +134,7 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !224 // CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !224 -// CHECK:STDOUT: %call = call noundef zeroext i8 @_Z8ReturnU8v() +// CHECK:STDOUT: %call = call noundef i8 @_Z8ReturnU8v() // CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !225 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -155,7 +155,7 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !228 // CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !228 -// CHECK:STDOUT: %call = call noundef zeroext i16 @_Z9ReturnU16v() +// CHECK:STDOUT: %call = call noundef i16 @_Z9ReturnU16v() // CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !229 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -194,7 +194,7 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !224 // CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !224 -// CHECK:STDOUT: %call = call noundef signext i8 @_Z8ReturnI8v() +// CHECK:STDOUT: %call = call noundef i8 @_Z8ReturnI8v() // CHECK:STDOUT: store i8 %call, ptr %0, align 1, !tbaa !225 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -215,7 +215,7 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !228 // CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !228 -// CHECK:STDOUT: %call = call noundef signext i16 @_Z9ReturnI16v() +// CHECK:STDOUT: %call = call noundef i16 @_Z9ReturnI16v() // CHECK:STDOUT: store i16 %call, ptr %0, align 2, !tbaa !229 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -365,13 +365,13 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: ret void, !dbg !218 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: declare noundef zeroext i8 @_Z8ReturnU8v() #2 +// CHECK:STDOUT: declare noundef i8 @_Z8ReturnU8v() #2 // CHECK:STDOUT: -// CHECK:STDOUT: declare noundef zeroext i16 @_Z9ReturnU16v() #2 +// CHECK:STDOUT: declare noundef i16 @_Z9ReturnU16v() #2 // CHECK:STDOUT: -// CHECK:STDOUT: declare noundef signext i8 @_Z8ReturnI8v() #2 +// CHECK:STDOUT: declare noundef i8 @_Z8ReturnI8v() #2 // CHECK:STDOUT: -// CHECK:STDOUT: declare noundef signext i16 @_Z9ReturnI16v() #2 +// CHECK:STDOUT: declare noundef i16 @_Z9ReturnI16v() #2 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 } @@ -386,8 +386,8 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!230, !231, !232, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!235} +// CHECK:STDOUT: !llvm.module.flags = !{!230, !231, !232, !233, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!236} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -540,12 +540,13 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: !227 = !{!"p1 short", !222, i64 0} // CHECK:STDOUT: !228 = !{!227, !227, i64 0} // CHECK:STDOUT: !229 = !{!226, !226, i64 0} -// CHECK:STDOUT: !230 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !231 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !232 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !233 = !{!"int", !221, i64 0} -// CHECK:STDOUT: !234 = !{!"__libc_errno", !233, i64 0} -// CHECK:STDOUT: !235 = !{!234, !233, i64 0} +// CHECK:STDOUT: !230 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !231 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !232 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !233 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !234 = !{!"int", !221, i64 0} +// CHECK:STDOUT: !235 = !{!"__libc_errno", !234, i64 0} +// CHECK:STDOUT: !236 = !{!235, !234, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_class.carbon' @@ -556,52 +557,52 @@ 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 !240 { +// CHECK:STDOUT: define void @_CGetX.Main(ptr sret([16 x i8]) %return) #0 !dbg !241 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %return), !dbg !243 -// CHECK:STDOUT: ret void, !dbg !244 +// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %return), !dbg !244 +// CHECK:STDOUT: ret void, !dbg !245 // 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 !263 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !263 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !264 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !264 // 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 !245 { +// CHECK:STDOUT: define void @_CLet.Main() #0 !dbg !246 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc9_27.1.temp = alloca [16 x i8], align 8, !dbg !246 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_27.1.temp), !dbg !246 -// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %.loc9_27.1.temp), !dbg !246 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr %.loc9_27.1.temp), !dbg !246 -// CHECK:STDOUT: ret void, !dbg !249 +// CHECK:STDOUT: %.loc9_27.1.temp = alloca [16 x i8], align 8, !dbg !247 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_27.1.temp), !dbg !247 +// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %.loc9_27.1.temp), !dbg !247 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr %.loc9_27.1.temp), !dbg !247 +// CHECK:STDOUT: ret void, !dbg !250 // 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 !250 { +// CHECK:STDOUT: define void @_CVar.Main() #0 !dbg !251 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !251 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !251 -// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %_.var), !dbg !252 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr %_.var), !dbg !251 -// CHECK:STDOUT: ret void, !dbg !254 +// CHECK:STDOUT: %_.var = alloca [16 x i8], align 8, !dbg !252 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !252 +// CHECK:STDOUT: call void @_Z4Makev.carbon_thunk.(ptr %_.var), !dbg !253 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr %_.var), !dbg !252 +// CHECK:STDOUT: ret void, !dbg !255 // 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 @_CSelfDestruct.Core.2d682b12c0c20e08(ptr %t) #0 !dbg !255 { -// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %t), !dbg !259 -// CHECK:STDOUT: ret void, !dbg !260 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr %t) #0 !dbg !256 { +// CHECK:STDOUT: call void @_ZN1XD1Ev(ptr %t), !dbg !260 +// CHECK:STDOUT: ret void, !dbg !261 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z4Makev(ptr dead_on_unwind writable sret(%struct.X) align 8) #4 @@ -616,9 +617,9 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!237} -// CHECK:STDOUT: !llvm.module.flags = !{!230, !231, !232, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!235} +// CHECK:STDOUT: !llvm.dbg.cu = !{!238} +// CHECK:STDOUT: !llvm.module.flags = !{!230, !231, !232, !233, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!236} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -631,33 +632,34 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: !220 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !221 = !{!"omnipotent char", !220, i64 0} // CHECK:STDOUT: !222 = !{!"any pointer", !221, i64 0} -// CHECK:STDOUT: !230 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !231 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !232 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !233 = !{!"int", !221, i64 0} -// CHECK:STDOUT: !234 = !{!"__libc_errno", !233, i64 0} -// CHECK:STDOUT: !235 = !{!234, !233, i64 0} -// CHECK:STDOUT: !236 = !DIFile(filename: "import_class.carbon", directory: "") -// CHECK:STDOUT: !237 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !236, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !238 = !{!16} -// CHECK:STDOUT: !239 = !DISubroutineType(types: !238) -// CHECK:STDOUT: !240 = distinct !DISubprogram(name: "GetX", linkageName: "_CGetX.Main", scope: null, file: !236, line: 6, type: !239, spFlags: DISPFlagDefinition, unit: !237) -// CHECK:STDOUT: !243 = !DILocation(line: 6, column: 29, scope: !240) -// CHECK:STDOUT: !244 = !DILocation(line: 6, column: 22, scope: !240) -// CHECK:STDOUT: !245 = distinct !DISubprogram(name: "Let", linkageName: "_CLet.Main", scope: null, file: !236, line: 8, type: !36, spFlags: DISPFlagDefinition, unit: !237) -// CHECK:STDOUT: !246 = !DILocation(line: 9, column: 18, scope: !245) -// CHECK:STDOUT: !249 = !DILocation(line: 8, column: 1, scope: !245) -// CHECK:STDOUT: !250 = distinct !DISubprogram(name: "Var", linkageName: "_CVar.Main", scope: null, file: !236, line: 12, type: !36, spFlags: DISPFlagDefinition, unit: !237) -// CHECK:STDOUT: !251 = !DILocation(line: 13, column: 3, scope: !250) -// CHECK:STDOUT: !252 = !DILocation(line: 13, column: 18, scope: !250) -// CHECK:STDOUT: !254 = !DILocation(line: 12, column: 1, scope: !250) -// CHECK:STDOUT: !255 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.2d682b12c0c20e08", scope: null, file: !163, line: 36, type: !18, spFlags: DISPFlagDefinition, unit: !237, retainedNodes: !261) -// CHECK:STDOUT: !256 = !DILocalVariable(arg: 1, scope: !255, type: !16) -// CHECK:STDOUT: !259 = !DILocation(line: 38, column: 5, scope: !255) -// CHECK:STDOUT: !260 = !DILocation(line: 36, column: 1, scope: !255) -// CHECK:STDOUT: !261 = !{!256} -// CHECK:STDOUT: !262 = !{!"p1 _ZTS1X", !222, i64 0} -// CHECK:STDOUT: !263 = !{!262, !262, i64 0} +// CHECK:STDOUT: !230 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !231 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !232 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !233 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !234 = !{!"int", !221, i64 0} +// CHECK:STDOUT: !235 = !{!"__libc_errno", !234, i64 0} +// CHECK:STDOUT: !236 = !{!235, !234, i64 0} +// CHECK:STDOUT: !237 = !DIFile(filename: "import_class.carbon", directory: "") +// CHECK:STDOUT: !238 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !237, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !239 = !{!16} +// CHECK:STDOUT: !240 = !DISubroutineType(types: !239) +// CHECK:STDOUT: !241 = distinct !DISubprogram(name: "GetX", linkageName: "_CGetX.Main", scope: null, file: !237, line: 6, type: !240, spFlags: DISPFlagDefinition, unit: !238) +// CHECK:STDOUT: !244 = !DILocation(line: 6, column: 29, scope: !241) +// CHECK:STDOUT: !245 = !DILocation(line: 6, column: 22, scope: !241) +// CHECK:STDOUT: !246 = distinct !DISubprogram(name: "Let", linkageName: "_CLet.Main", scope: null, file: !237, line: 8, type: !36, spFlags: DISPFlagDefinition, unit: !238) +// CHECK:STDOUT: !247 = !DILocation(line: 9, column: 18, scope: !246) +// CHECK:STDOUT: !250 = !DILocation(line: 8, column: 1, scope: !246) +// CHECK:STDOUT: !251 = distinct !DISubprogram(name: "Var", linkageName: "_CVar.Main", scope: null, file: !237, line: 12, type: !36, spFlags: DISPFlagDefinition, unit: !238) +// CHECK:STDOUT: !252 = !DILocation(line: 13, column: 3, scope: !251) +// CHECK:STDOUT: !253 = !DILocation(line: 13, column: 18, scope: !251) +// CHECK:STDOUT: !255 = !DILocation(line: 12, column: 1, scope: !251) +// CHECK:STDOUT: !256 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.2d682b12c0c20e08", scope: null, file: !163, line: 36, type: !18, spFlags: DISPFlagDefinition, unit: !238, retainedNodes: !262) +// CHECK:STDOUT: !257 = !DILocalVariable(arg: 1, scope: !256, type: !16) +// CHECK:STDOUT: !260 = !DILocation(line: 38, column: 5, scope: !256) +// CHECK:STDOUT: !261 = !DILocation(line: 36, column: 1, scope: !256) +// CHECK:STDOUT: !262 = !{!257} +// CHECK:STDOUT: !263 = !{!"p1 _ZTS1X", !222, i64 0} +// CHECK:STDOUT: !264 = !{!263, !263, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'indirect_return_with_args.carbon' @@ -669,10 +671,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 !271 { +// CHECK:STDOUT: define void @_CCall.Main(ptr sret({}) %return, ptr %x) #0 !dbg !272 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk._(ptr %x, ptr %return), !dbg !277 -// CHECK:STDOUT: ret void, !dbg !278 +// CHECK:STDOUT: call void @_Z1f1D.carbon_thunk._(ptr %x, ptr %return), !dbg !278 +// CHECK:STDOUT: ret void, !dbg !279 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -682,10 +684,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 !281 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !283 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !283 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !281 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !282 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !284 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !284 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !282 // CHECK:STDOUT: call void @_Z1f1D() // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -696,9 +698,9 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: attributes #1 = { alwaysinline 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" } // CHECK:STDOUT: attributes #2 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!266} -// CHECK:STDOUT: !llvm.module.flags = !{!230, !231, !232, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!235} +// CHECK:STDOUT: !llvm.dbg.cu = !{!267} +// CHECK:STDOUT: !llvm.module.flags = !{!230, !231, !232, !233, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!236} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -706,23 +708,24 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: !220 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !221 = !{!"omnipotent char", !220, i64 0} // CHECK:STDOUT: !222 = !{!"any pointer", !221, i64 0} -// CHECK:STDOUT: !230 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !231 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !232 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !233 = !{!"int", !221, i64 0} -// CHECK:STDOUT: !234 = !{!"__libc_errno", !233, i64 0} -// CHECK:STDOUT: !235 = !{!234, !233, i64 0} -// CHECK:STDOUT: !265 = !DIFile(filename: "indirect_return_with_args.carbon", directory: "") -// CHECK:STDOUT: !266 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !265, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !267 = !{!16, !16} -// CHECK:STDOUT: !268 = !DISubroutineType(types: !267) -// CHECK:STDOUT: !271 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !265, line: 10, type: !268, spFlags: DISPFlagDefinition, unit: !266, retainedNodes: !279) -// CHECK:STDOUT: !272 = !DILocalVariable(arg: 1, scope: !271, type: !16) -// CHECK:STDOUT: !277 = !DILocation(line: 11, column: 10, scope: !271) -// CHECK:STDOUT: !278 = !DILocation(line: 11, column: 3, scope: !271) -// CHECK:STDOUT: !279 = !{!272} -// CHECK:STDOUT: !280 = !{!"p1 _ZTS1D", !222, i64 0} -// CHECK:STDOUT: !281 = !{!280, !280, i64 0} -// CHECK:STDOUT: !282 = !{!"p1 _ZTS1C", !222, i64 0} -// CHECK:STDOUT: !283 = !{!282, !282, i64 0} +// CHECK:STDOUT: !230 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !231 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !232 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !233 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !234 = !{!"int", !221, i64 0} +// CHECK:STDOUT: !235 = !{!"__libc_errno", !234, i64 0} +// CHECK:STDOUT: !236 = !{!235, !234, i64 0} +// CHECK:STDOUT: !266 = !DIFile(filename: "indirect_return_with_args.carbon", directory: "") +// CHECK:STDOUT: !267 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !266, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !268 = !{!16, !16} +// CHECK:STDOUT: !269 = !DISubroutineType(types: !268) +// CHECK:STDOUT: !272 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !266, line: 10, type: !269, spFlags: DISPFlagDefinition, unit: !267, retainedNodes: !280) +// CHECK:STDOUT: !273 = !DILocalVariable(arg: 1, scope: !272, type: !16) +// CHECK:STDOUT: !278 = !DILocation(line: 11, column: 10, scope: !272) +// CHECK:STDOUT: !279 = !DILocation(line: 11, column: 3, scope: !272) +// CHECK:STDOUT: !280 = !{!273} +// CHECK:STDOUT: !281 = !{!"p1 _ZTS1D", !222, i64 0} +// CHECK:STDOUT: !282 = !{!281, !281, i64 0} +// CHECK:STDOUT: !283 = !{!"p1 _ZTS1C", !222, i64 0} +// CHECK:STDOUT: !284 = !{!283, !283, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/globals.carbon b/toolchain/lower/testdata/interop/cpp/globals.carbon index 32c493e90b1e..6382dfd8d830 100644 --- a/toolchain/lower/testdata/interop/cpp/globals.carbon +++ b/toolchain/lower/testdata/interop/cpp/globals.carbon @@ -173,8 +173,8 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!24} -// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !7, !8} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!36} +// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !35, !7, !8} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!37} // CHECK:STDOUT: // CHECK:STDOUT: !1 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !2 = !{!"omnipotent char", !1, i64 0} @@ -187,11 +187,12 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: !26 = !DISubroutineType(types: !25) // CHECK:STDOUT: !27 = distinct !DISubprogram(name: "MyF", linkageName: "_CMyF.Main", scope: null, file: !23, line: 6, type: !26, spFlags: DISPFlagDefinition, unit: !24) // CHECK:STDOUT: !31 = !DILocation(line: 6, column: 1, scope: !27) -// CHECK:STDOUT: !32 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !33 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !34 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !35 = !{!"__libc_errno", !3, i64 0} -// CHECK:STDOUT: !36 = !{!35, !3, i64 0} +// CHECK:STDOUT: !32 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !33 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !34 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !35 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !36 = !{!"__libc_errno", !3, i64 0} +// CHECK:STDOUT: !37 = !{!36, !3, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_inline.carbon' @@ -273,10 +274,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 !42 { +// CHECK:STDOUT: define void @_CCallF.Main() #1 !dbg !43 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN7InlineC1fEv(ptr @inline_global), !dbg !43 -// CHECK:STDOUT: ret void, !dbg !44 +// CHECK:STDOUT: call void @_ZN7InlineC1fEv(ptr @inline_global), !dbg !44 +// CHECK:STDOUT: ret void, !dbg !45 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN7InlineC1fEv(ptr noundef nonnull align 1 dereferenceable(1)) #2 @@ -290,9 +291,9 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: attributes #2 = { "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" } // CHECK:STDOUT: attributes #3 = { nounwind "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!38} -// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !7, !8} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!36} +// CHECK:STDOUT: !llvm.dbg.cu = !{!39} +// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !35, !7, !8} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!37} // CHECK:STDOUT: // CHECK:STDOUT: !1 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !2 = !{!"omnipotent char", !1, i64 0} @@ -301,16 +302,17 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: !8 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !25 = !{null} // CHECK:STDOUT: !26 = !DISubroutineType(types: !25) -// CHECK:STDOUT: !32 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !33 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !34 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !35 = !{!"__libc_errno", !3, i64 0} -// CHECK:STDOUT: !36 = !{!35, !3, i64 0} -// CHECK:STDOUT: !37 = !DIFile(filename: "import_inline.carbon", directory: "") -// CHECK:STDOUT: !38 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !37, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main", scope: null, file: !37, line: 6, type: !26, spFlags: DISPFlagDefinition, unit: !38) -// CHECK:STDOUT: !43 = !DILocation(line: 7, column: 3, scope: !42) -// CHECK:STDOUT: !44 = !DILocation(line: 6, column: 1, scope: !42) +// CHECK:STDOUT: !32 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !33 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !34 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !35 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !36 = !{!"__libc_errno", !3, i64 0} +// CHECK:STDOUT: !37 = !{!36, !3, i64 0} +// CHECK:STDOUT: !38 = !DIFile(filename: "import_inline.carbon", directory: "") +// CHECK:STDOUT: !39 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !38, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !43 = distinct !DISubprogram(name: "CallF", linkageName: "_CCallF.Main", scope: null, file: !38, line: 6, type: !26, spFlags: DISPFlagDefinition, unit: !39) +// CHECK:STDOUT: !44 = !DILocation(line: 7, column: 3, scope: !43) +// CHECK:STDOUT: !45 = !DILocation(line: 6, column: 1, scope: !43) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'todo_import_thread_local.carbon' @@ -343,17 +345,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 !50 { +// CHECK:STDOUT: define void @_CThreadLocalStore.Main() #3 !dbg !51 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: store i32 42, ptr @thread_local_global, align 4, !dbg !51 -// CHECK:STDOUT: ret void, !dbg !52 +// CHECK:STDOUT: store i32 42, ptr @thread_local_global, align 4, !dbg !52 +// CHECK:STDOUT: ret void, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CThreadLocalTriggerInit.Main() #3 !dbg !53 { +// CHECK:STDOUT: define i32 @_CThreadLocalTriggerInit.Main() #3 !dbg !54 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc14 = load i32, ptr @thread_local_global_with_init, align 4, !dbg !56 -// CHECK:STDOUT: ret i32 %.loc14, !dbg !57 +// CHECK:STDOUT: %.loc14 = load i32, ptr @thread_local_global_with_init, align 4, !dbg !57 +// CHECK:STDOUT: ret i32 %.loc14, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: uwtable @@ -361,7 +363,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 !58 +// CHECK:STDOUT: br i1 %guard.uninitialized, label %init, label %exit, !prof !59 // CHECK:STDOUT: // CHECK:STDOUT: init: ; preds = %entry // CHECK:STDOUT: store i8 1, ptr @__tls_guard, align 1 @@ -396,9 +398,9 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #5 = { uwtable "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!46} -// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !7, !8} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!36} +// CHECK:STDOUT: !llvm.dbg.cu = !{!47} +// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !35, !7, !8} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!37} // CHECK:STDOUT: // CHECK:STDOUT: !1 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !2 = !{!"omnipotent char", !1, i64 0} @@ -408,23 +410,24 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: !8 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !25 = !{null} // CHECK:STDOUT: !26 = !DISubroutineType(types: !25) -// CHECK:STDOUT: !32 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !33 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !34 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !35 = !{!"__libc_errno", !3, i64 0} -// CHECK:STDOUT: !36 = !{!35, !3, i64 0} -// CHECK:STDOUT: !45 = !DIFile(filename: "todo_import_thread_local.carbon", directory: "") -// CHECK:STDOUT: !46 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !45, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !47 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !48 = !{!47} -// CHECK:STDOUT: !49 = !DISubroutineType(types: !48) -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "ThreadLocalStore", linkageName: "_CThreadLocalStore.Main", scope: null, file: !45, line: 9, type: !26, spFlags: DISPFlagDefinition, unit: !46) -// CHECK:STDOUT: !51 = !DILocation(line: 10, column: 3, scope: !50) -// CHECK:STDOUT: !52 = !DILocation(line: 9, column: 1, scope: !50) -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "ThreadLocalTriggerInit", linkageName: "_CThreadLocalTriggerInit.Main", scope: null, file: !45, line: 13, type: !49, spFlags: DISPFlagDefinition, unit: !46) -// CHECK:STDOUT: !56 = !DILocation(line: 14, column: 10, scope: !53) -// CHECK:STDOUT: !57 = !DILocation(line: 14, column: 3, scope: !53) -// CHECK:STDOUT: !58 = !{!"branch_weights", i32 1, i32 1023} +// CHECK:STDOUT: !32 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !33 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !34 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !35 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !36 = !{!"__libc_errno", !3, i64 0} +// CHECK:STDOUT: !37 = !{!36, !3, i64 0} +// CHECK:STDOUT: !46 = !DIFile(filename: "todo_import_thread_local.carbon", directory: "") +// CHECK:STDOUT: !47 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !46, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !48 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !49 = !{!48} +// CHECK:STDOUT: !50 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "ThreadLocalStore", linkageName: "_CThreadLocalStore.Main", scope: null, file: !46, line: 9, type: !26, spFlags: DISPFlagDefinition, unit: !47) +// CHECK:STDOUT: !52 = !DILocation(line: 10, column: 3, scope: !51) +// CHECK:STDOUT: !53 = !DILocation(line: 9, column: 1, scope: !51) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "ThreadLocalTriggerInit", linkageName: "_CThreadLocalTriggerInit.Main", scope: null, file: !46, line: 13, type: !50, spFlags: DISPFlagDefinition, unit: !47) +// CHECK:STDOUT: !57 = !DILocation(line: 14, column: 10, scope: !54) +// CHECK:STDOUT: !58 = !DILocation(line: 14, column: 3, scope: !54) +// CHECK:STDOUT: !59 = !{!"branch_weights", i32 1, i32 1023} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_static.carbon' @@ -437,36 +440,37 @@ 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 !61 { +// CHECK:STDOUT: define i32 @_CReadStatic.Main() #0 !dbg !62 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7 = load i32, ptr @_ZN1X1nE, align 4, !dbg !64 -// CHECK:STDOUT: ret i32 %.loc7, !dbg !65 +// CHECK:STDOUT: %.loc7 = load i32, ptr @_ZN1X1nE, align 4, !dbg !65 +// CHECK:STDOUT: ret i32 %.loc7, !dbg !66 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!60} -// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !7, !8} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!36} +// CHECK:STDOUT: !llvm.dbg.cu = !{!61} +// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !35, !7, !8} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!37} // CHECK:STDOUT: // CHECK:STDOUT: !1 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !2 = !{!"omnipotent char", !1, i64 0} // CHECK:STDOUT: !3 = !{!"int", !2, i64 0} // CHECK:STDOUT: !7 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !8 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !32 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !33 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !34 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !35 = !{!"__libc_errno", !3, i64 0} -// CHECK:STDOUT: !36 = !{!35, !3, i64 0} -// CHECK:STDOUT: !47 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !48 = !{!47} -// CHECK:STDOUT: !49 = !DISubroutineType(types: !48) -// CHECK:STDOUT: !59 = !DIFile(filename: "import_static.carbon", directory: "") -// CHECK:STDOUT: !60 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !59, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !61 = distinct !DISubprogram(name: "ReadStatic", linkageName: "_CReadStatic.Main", scope: null, file: !59, line: 6, type: !49, spFlags: DISPFlagDefinition, unit: !60) -// CHECK:STDOUT: !64 = !DILocation(line: 7, column: 10, scope: !61) -// CHECK:STDOUT: !65 = !DILocation(line: 7, column: 3, scope: !61) +// CHECK:STDOUT: !32 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !33 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !34 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !35 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !36 = !{!"__libc_errno", !3, i64 0} +// CHECK:STDOUT: !37 = !{!36, !3, i64 0} +// CHECK:STDOUT: !48 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !49 = !{!48} +// CHECK:STDOUT: !50 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !60 = !DIFile(filename: "import_static.carbon", directory: "") +// CHECK:STDOUT: !61 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !60, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "ReadStatic", linkageName: "_CReadStatic.Main", scope: null, file: !60, line: 6, type: !50, spFlags: DISPFlagDefinition, unit: !61) +// CHECK:STDOUT: !65 = !DILocation(line: 7, column: 10, scope: !62) +// CHECK:STDOUT: !66 = !DILocation(line: 7, column: 3, scope: !62) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_var_template.carbon' @@ -480,47 +484,48 @@ 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 !70 { +// CHECK:STDOUT: define i32 @_CReadVarTemplate.Main() #0 !dbg !71 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7 = load i32, ptr @_Z4tmplIiE, align 4, !dbg !73 -// CHECK:STDOUT: ret i32 %.loc7, !dbg !74 +// CHECK:STDOUT: %.loc7 = load i32, ptr @_Z4tmplIiE, align 4, !dbg !74 +// CHECK:STDOUT: ret i32 %.loc7, !dbg !75 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReadVarTemplateWithConstructor.Main() #0 !dbg !75 { +// CHECK:STDOUT: define ptr @_CReadVarTemplateWithConstructor.Main() #0 !dbg !76 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr @_Z4tmplI1YE, !dbg !78 +// CHECK:STDOUT: ret ptr @_Z4tmplI1YE, !dbg !79 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!67} -// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !7, !8} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!36} +// CHECK:STDOUT: !llvm.dbg.cu = !{!68} +// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !35, !7, !8} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!37} // CHECK:STDOUT: // CHECK:STDOUT: !1 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !2 = !{!"omnipotent char", !1, i64 0} // CHECK:STDOUT: !3 = !{!"int", !2, i64 0} // CHECK:STDOUT: !7 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !8 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !32 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !33 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !34 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !35 = !{!"__libc_errno", !3, i64 0} -// CHECK:STDOUT: !36 = !{!35, !3, i64 0} -// CHECK:STDOUT: !39 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !47 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !48 = !{!47} -// CHECK:STDOUT: !49 = !DISubroutineType(types: !48) -// CHECK:STDOUT: !66 = !DIFile(filename: "import_var_template.carbon", directory: "") -// CHECK:STDOUT: !67 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !66, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !68 = !{!39} -// CHECK:STDOUT: !69 = !DISubroutineType(types: !68) -// CHECK:STDOUT: !70 = distinct !DISubprogram(name: "ReadVarTemplate", linkageName: "_CReadVarTemplate.Main", scope: null, file: !66, line: 6, type: !49, spFlags: DISPFlagDefinition, unit: !67) -// CHECK:STDOUT: !73 = !DILocation(line: 7, column: 10, scope: !70) -// CHECK:STDOUT: !74 = !DILocation(line: 7, column: 3, scope: !70) -// CHECK:STDOUT: !75 = distinct !DISubprogram(name: "ReadVarTemplateWithConstructor", linkageName: "_CReadVarTemplateWithConstructor.Main", scope: null, file: !66, line: 10, type: !69, spFlags: DISPFlagDefinition, unit: !67) -// CHECK:STDOUT: !78 = !DILocation(line: 11, column: 3, scope: !75) +// CHECK:STDOUT: !32 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !33 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !34 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !35 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !36 = !{!"__libc_errno", !3, i64 0} +// CHECK:STDOUT: !37 = !{!36, !3, i64 0} +// CHECK:STDOUT: !40 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !48 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !49 = !{!48} +// CHECK:STDOUT: !50 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !67 = !DIFile(filename: "import_var_template.carbon", directory: "") +// CHECK:STDOUT: !68 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !67, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !69 = !{!40} +// CHECK:STDOUT: !70 = !DISubroutineType(types: !69) +// CHECK:STDOUT: !71 = distinct !DISubprogram(name: "ReadVarTemplate", linkageName: "_CReadVarTemplate.Main", scope: null, file: !67, line: 6, type: !50, spFlags: DISPFlagDefinition, unit: !68) +// CHECK:STDOUT: !74 = !DILocation(line: 7, column: 10, scope: !71) +// CHECK:STDOUT: !75 = !DILocation(line: 7, column: 3, scope: !71) +// CHECK:STDOUT: !76 = distinct !DISubprogram(name: "ReadVarTemplateWithConstructor", linkageName: "_CReadVarTemplateWithConstructor.Main", scope: null, file: !67, line: 10, type: !70, spFlags: DISPFlagDefinition, unit: !68) +// CHECK:STDOUT: !79 = !DILocation(line: 11, column: 3, scope: !76) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'import_static_template.carbon' @@ -534,45 +539,46 @@ fn ReadStaticVarTemplateWithConstructor() -> Cpp.Y* { // CHECK:STDOUT: @_ZN11StaticTmplX11static_tmplI1YEE = external global %struct.Y.26, align 1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CReadStaticVarTemplate.Main() #0 !dbg !81 { +// CHECK:STDOUT: define i32 @_CReadStaticVarTemplate.Main() #0 !dbg !82 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc7 = load i32, ptr @_ZN11StaticTmplX11static_tmplIiEE, align 4, !dbg !84 -// CHECK:STDOUT: ret i32 %.loc7, !dbg !85 +// CHECK:STDOUT: %.loc7 = load i32, ptr @_ZN11StaticTmplX11static_tmplIiEE, align 4, !dbg !85 +// CHECK:STDOUT: ret i32 %.loc7, !dbg !86 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReadStaticVarTemplateWithConstructor.Main() #0 !dbg !86 { +// CHECK:STDOUT: define ptr @_CReadStaticVarTemplateWithConstructor.Main() #0 !dbg !87 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr @_ZN11StaticTmplX11static_tmplI1YEE, !dbg !89 +// CHECK:STDOUT: ret ptr @_ZN11StaticTmplX11static_tmplI1YEE, !dbg !90 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!80} -// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !7, !8} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!36} +// CHECK:STDOUT: !llvm.dbg.cu = !{!81} +// CHECK:STDOUT: !llvm.module.flags = !{!32, !33, !34, !35, !7, !8} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!37} // CHECK:STDOUT: // CHECK:STDOUT: !1 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !2 = !{!"omnipotent char", !1, i64 0} // CHECK:STDOUT: !3 = !{!"int", !2, i64 0} // CHECK:STDOUT: !7 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !8 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !32 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !33 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !34 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !35 = !{!"__libc_errno", !3, i64 0} -// CHECK:STDOUT: !36 = !{!35, !3, i64 0} -// CHECK:STDOUT: !39 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !47 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !48 = !{!47} -// CHECK:STDOUT: !49 = !DISubroutineType(types: !48) -// CHECK:STDOUT: !68 = !{!39} -// CHECK:STDOUT: !69 = !DISubroutineType(types: !68) -// CHECK:STDOUT: !79 = !DIFile(filename: "import_static_template.carbon", directory: "") -// CHECK:STDOUT: !80 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !79, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "ReadStaticVarTemplate", linkageName: "_CReadStaticVarTemplate.Main", scope: null, file: !79, line: 6, type: !49, spFlags: DISPFlagDefinition, unit: !80) -// CHECK:STDOUT: !84 = !DILocation(line: 7, column: 10, scope: !81) -// CHECK:STDOUT: !85 = !DILocation(line: 7, column: 3, scope: !81) -// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "ReadStaticVarTemplateWithConstructor", linkageName: "_CReadStaticVarTemplateWithConstructor.Main", scope: null, file: !79, line: 10, type: !69, spFlags: DISPFlagDefinition, unit: !80) -// CHECK:STDOUT: !89 = !DILocation(line: 11, column: 3, scope: !86) +// CHECK:STDOUT: !32 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !33 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !34 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !35 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !36 = !{!"__libc_errno", !3, i64 0} +// CHECK:STDOUT: !37 = !{!36, !3, i64 0} +// CHECK:STDOUT: !40 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !48 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !49 = !{!48} +// CHECK:STDOUT: !50 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !69 = !{!40} +// CHECK:STDOUT: !70 = !DISubroutineType(types: !69) +// CHECK:STDOUT: !80 = !DIFile(filename: "import_static_template.carbon", directory: "") +// CHECK:STDOUT: !81 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !80, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "ReadStaticVarTemplate", linkageName: "_CReadStaticVarTemplate.Main", scope: null, file: !80, line: 6, type: !50, spFlags: DISPFlagDefinition, unit: !81) +// CHECK:STDOUT: !85 = !DILocation(line: 7, column: 10, scope: !82) +// CHECK:STDOUT: !86 = !DILocation(line: 7, column: 3, scope: !82) +// CHECK:STDOUT: !87 = distinct !DISubprogram(name: "ReadStaticVarTemplateWithConstructor", linkageName: "_CReadStaticVarTemplateWithConstructor.Main", scope: null, file: !80, line: 10, type: !70, spFlags: DISPFlagDefinition, unit: !81) +// CHECK:STDOUT: !90 = !DILocation(line: 11, column: 3, scope: !87) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/issue7142.carbon b/toolchain/lower/testdata/interop/cpp/issue7142.carbon index 1b226b19f02f..106f707474f7 100644 --- a/toolchain/lower/testdata/interop/cpp/issue7142.carbon +++ b/toolchain/lower/testdata/interop/cpp/issue7142.carbon @@ -116,8 +116,8 @@ void f() { // CHECK:STDOUT: attributes #4 = { alwaysinline 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!56} +// CHECK:STDOUT: !llvm.module.flags = !{!52, !53, !54, !55, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!57} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -160,9 +160,10 @@ void f() { // CHECK:STDOUT: !47 = !{!"int", !46, i64 0} // CHECK:STDOUT: !48 = !{!"_ZTSN6Carbon4Main1AE", !47, i64 0} // CHECK:STDOUT: !49 = !{!48, !47, i64 0} -// CHECK:STDOUT: !52 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !53 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !54 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !55 = !{!"__libc_errno", !47, i64 0} -// CHECK:STDOUT: !56 = !{!55, !47, i64 0} +// CHECK:STDOUT: !52 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !53 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !54 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !55 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !56 = !{!"__libc_errno", !47, i64 0} +// CHECK:STDOUT: !57 = !{!56, !47, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/nullptr.carbon b/toolchain/lower/testdata/interop/cpp/nullptr.carbon index 354fba20cd89..31034badb250 100644 --- a/toolchain/lower/testdata/interop/cpp/nullptr.carbon +++ b/toolchain/lower/testdata/interop/cpp/nullptr.carbon @@ -191,8 +191,8 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!89, !90, !91, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!94} +// CHECK:STDOUT: !llvm.module.flags = !{!89, !90, !91, !92, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!95} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -256,10 +256,11 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: !86 = !{!"p1 std::nullptr_t", !85, i64 0} // CHECK:STDOUT: !87 = !{!86, !86, i64 0} // CHECK:STDOUT: !88 = !{!84, !84, i64 0} -// CHECK:STDOUT: !89 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !90 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !91 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !92 = !{!"int", !83, i64 0} -// CHECK:STDOUT: !93 = !{!"__libc_errno", !92, i64 0} -// CHECK:STDOUT: !94 = !{!93, !92, i64 0} +// CHECK:STDOUT: !89 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !90 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !91 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !92 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !93 = !{!"int", !83, i64 0} +// CHECK:STDOUT: !94 = !{!"__libc_errno", !93, i64 0} +// CHECK:STDOUT: !95 = !{!94, !93, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/operators.carbon b/toolchain/lower/testdata/interop/cpp/operators.carbon index ba06367f4dfb..ff84a438d9f2 100644 --- a/toolchain/lower/testdata/interop/cpp/operators.carbon +++ b/toolchain/lower/testdata/interop/cpp/operators.carbon @@ -229,8 +229,8 @@ fn Driver(x: Cpp.OrderedA, y: Cpp.OrderedA) { // CHECK:STDOUT: attributes #4 = { 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!61, !62, !63, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!65} +// CHECK:STDOUT: !llvm.module.flags = !{!61, !62, !63, !64, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!66} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -278,11 +278,12 @@ fn Driver(x: Cpp.OrderedA, y: Cpp.OrderedA) { // CHECK:STDOUT: !58 = !{i64 0, i64 4, !57} // CHECK:STDOUT: !59 = !{!52, !52, i64 0} // CHECK:STDOUT: !60 = !{!56, !55, i64 0} -// CHECK:STDOUT: !61 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !62 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !63 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !64 = !{!"__libc_errno", !55, i64 0} -// CHECK:STDOUT: !65 = !{!64, !55, i64 0} +// CHECK:STDOUT: !61 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !62 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !63 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !64 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !65 = !{!"__libc_errno", !55, i64 0} +// CHECK:STDOUT: !66 = !{!65, !55, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'ordered_with.carbon' @@ -301,10 +302,10 @@ fn Driver(x: Cpp.OrderedA, y: Cpp.OrderedA) { // CHECK:STDOUT: $_Zge8OrderedAS_ = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CDriver.Main(ptr %x, ptr %y) #0 !dbg !68 { +// CHECK:STDOUT: define void @_CDriver.Main(ptr %x, ptr %y) #0 !dbg !69 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_CCheckOrderedWith.Main.b948edeb3216062b(ptr %x, ptr %y), !dbg !75 -// CHECK:STDOUT: ret void, !dbg !76 +// CHECK:STDOUT: call void @_CCheckOrderedWith.Main.b948edeb3216062b(ptr %x, ptr %y), !dbg !76 +// CHECK:STDOUT: ret void, !dbg !77 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -315,13 +316,13 @@ fn Driver(x: Cpp.OrderedA, y: Cpp.OrderedA) { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.OrderedA, align 4 // CHECK:STDOUT: %agg.tmp1 = alloca %struct.OrderedA, align 4 -// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !118 -// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !118 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !119 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !119 // CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !54 // CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !54 -// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !118 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !119 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !58 -// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !118 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !119 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !58 // CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 @@ -341,13 +342,13 @@ fn Driver(x: Cpp.OrderedA, y: Cpp.OrderedA) { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.OrderedA, align 4 // CHECK:STDOUT: %agg.tmp1 = alloca %struct.OrderedA, align 4 -// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !118 -// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !118 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !119 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !119 // CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !54 // CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !54 -// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !118 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !119 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !58 -// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !118 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !119 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !58 // CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 @@ -367,13 +368,13 @@ fn Driver(x: Cpp.OrderedA, y: Cpp.OrderedA) { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.OrderedA, align 4 // CHECK:STDOUT: %agg.tmp1 = alloca %struct.OrderedA, align 4 -// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !118 -// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !118 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !119 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !119 // CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !54 // CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !54 -// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !118 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !119 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !58 -// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !118 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !119 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !58 // CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 @@ -393,13 +394,13 @@ fn Driver(x: Cpp.OrderedA, y: Cpp.OrderedA) { // CHECK:STDOUT: %return.addr = alloca ptr, align 8 // CHECK:STDOUT: %agg.tmp = alloca %struct.OrderedA, align 4 // CHECK:STDOUT: %agg.tmp1 = alloca %struct.OrderedA, align 4 -// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !118 -// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !118 +// CHECK:STDOUT: store ptr %x, ptr %x.addr, align 8, !tbaa !119 +// CHECK:STDOUT: store ptr %y, ptr %y.addr, align 8, !tbaa !119 // CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !54 // CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !54 -// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !118 +// CHECK:STDOUT: %1 = load ptr, ptr %x.addr, align 8, !tbaa !119 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp, ptr align 4 %1, i64 4, i1 false), !tbaa.struct !58 -// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !118 +// CHECK:STDOUT: %2 = load ptr, ptr %y.addr, align 8, !tbaa !119 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %agg.tmp1, ptr align 4 %2, i64 4, i1 false), !tbaa.struct !58 // CHECK:STDOUT: %coerce.dive = getelementptr inbounds nuw %struct.OrderedA, ptr %agg.tmp, i32 0, i32 0 // CHECK:STDOUT: %3 = load i32, ptr %coerce.dive, align 4 @@ -412,53 +413,53 @@ fn Driver(x: Cpp.OrderedA, y: Cpp.OrderedA) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CLess:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !78 { +// CHECK:STDOUT: define weak_odr i1 @"_CLess:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !79 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !82 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !82 -// CHECK:STDOUT: call void @_Zlt8OrderedAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !82 -// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !82 -// CHECK:STDOUT: ret i1 %0, !dbg !82 +// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !83 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !83 +// CHECK:STDOUT: call void @_Zlt8OrderedAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !83 +// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !83 +// CHECK:STDOUT: ret i1 %0, !dbg !83 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CLessOrEquivalent:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !84 { +// CHECK:STDOUT: define weak_odr i1 @"_CLessOrEquivalent:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !85 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !88 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !88 -// CHECK:STDOUT: call void @_Zle8OrderedAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !88 -// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !88 -// CHECK:STDOUT: ret i1 %0, !dbg !88 +// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !89 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !89 +// CHECK:STDOUT: call void @_Zle8OrderedAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !89 +// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !89 +// CHECK:STDOUT: ret i1 %0, !dbg !89 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CGreater:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !90 { +// CHECK:STDOUT: define weak_odr i1 @"_CGreater:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !91 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !94 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !94 -// CHECK:STDOUT: call void @_Zgt8OrderedAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !94 -// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !94 -// CHECK:STDOUT: ret i1 %0, !dbg !94 +// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !95 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !95 +// CHECK:STDOUT: call void @_Zgt8OrderedAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !95 +// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !95 +// CHECK:STDOUT: ret i1 %0, !dbg !95 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !96 { +// CHECK:STDOUT: define weak_odr i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %self, ptr %other) #2 !dbg !97 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !100 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !100 -// CHECK:STDOUT: call void @_Zge8OrderedAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !100 -// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !100 -// CHECK:STDOUT: ret i1 %0, !dbg !100 +// CHECK:STDOUT: %.6.temp = alloca i1, align 1, !dbg !101 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.6.temp), !dbg !101 +// CHECK:STDOUT: call void @_Zge8OrderedAS_.carbon_thunk.__(ptr %self, ptr %other, ptr %.6.temp), !dbg !101 +// CHECK:STDOUT: %0 = load i1, ptr %.6.temp, align 1, !dbg !101 +// CHECK:STDOUT: ret i1 %0, !dbg !101 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CCheckOrderedWith.Main.b948edeb3216062b(ptr %x, ptr %y) #0 !dbg !102 { +// CHECK:STDOUT: define linkonce_odr void @_CCheckOrderedWith.Main.b948edeb3216062b(ptr %x, ptr %y) #0 !dbg !103 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %OrderedWith.WithSelf.Less.call = call i1 @"_CLess:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %x, ptr %y), !dbg !107 -// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.call = call i1 @"_CGreater:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %x, ptr %y), !dbg !109 -// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.call = call i1 @"_CLessOrEquivalent:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %x, ptr %y), !dbg !111 -// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.call = call i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %x, ptr %y), !dbg !113 -// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: %OrderedWith.WithSelf.Less.call = call i1 @"_CLess:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %x, ptr %y), !dbg !108 +// CHECK:STDOUT: %OrderedWith.WithSelf.Greater.call = call i1 @"_CGreater:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %x, ptr %y), !dbg !110 +// CHECK:STDOUT: %OrderedWith.WithSelf.LessOrEquivalent.call = call i1 @"_CLessOrEquivalent:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %x, ptr %y), !dbg !112 +// CHECK:STDOUT: %OrderedWith.WithSelf.GreaterOrEquivalent.call = call i1 @"_CGreaterOrEquivalent:thunk:OrderedWith.f3924169c098de0f.Core:Cpp"(ptr %x, ptr %y), !dbg !114 +// CHECK:STDOUT: ret void, !dbg !116 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -474,9 +475,9 @@ fn Driver(x: Cpp.OrderedA, y: Cpp.OrderedA) { // CHECK:STDOUT: %coerce.dive1 = getelementptr inbounds nuw %struct.OrderedA, ptr %y, i32 0, i32 0 // CHECK:STDOUT: store i32 %y.coerce, ptr %coerce.dive1, align 4 // CHECK:STDOUT: %value = getelementptr inbounds nuw %struct.OrderedA, ptr %x, i32 0, i32 0 -// CHECK:STDOUT: %0 = load i32, ptr %value, align 4, !tbaa !120 +// CHECK:STDOUT: %0 = load i32, ptr %value, align 4, !tbaa !121 // CHECK:STDOUT: %value2 = getelementptr inbounds nuw %struct.OrderedA, ptr %y, i32 0, i32 0 -// CHECK:STDOUT: %1 = load i32, ptr %value2, align 4, !tbaa !120 +// CHECK:STDOUT: %1 = load i32, ptr %value2, align 4, !tbaa !121 // CHECK:STDOUT: %cmp = icmp slt i32 %0, %1 // CHECK:STDOUT: ret i1 %cmp // CHECK:STDOUT: } @@ -559,9 +560,9 @@ fn Driver(x: Cpp.OrderedA, y: Cpp.OrderedA) { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #4 = { 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!67} -// CHECK:STDOUT: !llvm.module.flags = !{!61, !62, !63, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!65} +// CHECK:STDOUT: !llvm.dbg.cu = !{!68} +// CHECK:STDOUT: !llvm.module.flags = !{!61, !62, !63, !64, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!66} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -580,50 +581,51 @@ fn Driver(x: Cpp.OrderedA, y: Cpp.OrderedA) { // CHECK:STDOUT: !57 = !{!55, !55, i64 0} // CHECK:STDOUT: !58 = !{i64 0, i64 4, !57} // CHECK:STDOUT: !59 = !{!52, !52, i64 0} -// CHECK:STDOUT: !61 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !62 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !63 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !64 = !{!"__libc_errno", !55, i64 0} -// CHECK:STDOUT: !65 = !{!64, !55, i64 0} -// CHECK:STDOUT: !66 = !DIFile(filename: "ordered_with.carbon", directory: "") -// CHECK:STDOUT: !67 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !66, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "Driver", linkageName: "_CDriver.Main", scope: null, file: !66, line: 33, type: !9, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !77) -// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !7) -// CHECK:STDOUT: !70 = !DILocalVariable(arg: 2, scope: !68, type: !7) -// CHECK:STDOUT: !75 = !DILocation(line: 34, column: 3, scope: !68) -// CHECK:STDOUT: !76 = !DILocation(line: 33, column: 1, scope: !68) -// CHECK:STDOUT: !77 = !{!69, !70} -// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "Less", linkageName: "_CLess:thunk:OrderedWith.f3924169c098de0f.Core:Cpp", scope: null, file: !66, line: 8, type: !13, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !83) -// CHECK:STDOUT: !79 = !DILocalVariable(arg: 1, scope: !78, type: !7) -// CHECK:STDOUT: !80 = !DILocalVariable(arg: 2, scope: !78, type: !7) -// CHECK:STDOUT: !82 = !DILocation(line: 8, column: 15, scope: !78) -// CHECK:STDOUT: !83 = !{!79, !80} -// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "LessOrEquivalent", linkageName: "_CLessOrEquivalent:thunk:OrderedWith.f3924169c098de0f.Core:Cpp", scope: null, file: !66, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !89) -// CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !84, type: !7) -// CHECK:STDOUT: !86 = !DILocalVariable(arg: 2, scope: !84, type: !7) -// CHECK:STDOUT: !88 = !DILocation(line: 16, column: 15, scope: !84) -// CHECK:STDOUT: !89 = !{!85, !86} -// CHECK:STDOUT: !90 = distinct !DISubprogram(name: "Greater", linkageName: "_CGreater:thunk:OrderedWith.f3924169c098de0f.Core:Cpp", scope: null, file: !66, line: 12, type: !13, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !95) -// CHECK:STDOUT: !91 = !DILocalVariable(arg: 1, scope: !90, type: !7) -// CHECK:STDOUT: !92 = !DILocalVariable(arg: 2, scope: !90, type: !7) -// CHECK:STDOUT: !94 = !DILocation(line: 12, column: 15, scope: !90) -// CHECK:STDOUT: !95 = !{!91, !92} -// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "GreaterOrEquivalent", linkageName: "_CGreaterOrEquivalent:thunk:OrderedWith.f3924169c098de0f.Core:Cpp", scope: null, file: !66, line: 20, type: !13, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !101) -// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !96, type: !7) -// CHECK:STDOUT: !98 = !DILocalVariable(arg: 2, scope: !96, type: !7) -// CHECK:STDOUT: !100 = !DILocation(line: 20, column: 15, scope: !96) -// CHECK:STDOUT: !101 = !{!97, !98} -// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "CheckOrderedWith", linkageName: "_CCheckOrderedWith.Main.b948edeb3216062b", scope: null, file: !66, line: 26, type: !9, spFlags: DISPFlagDefinition, unit: !67, retainedNodes: !116) -// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !102, type: !7) -// CHECK:STDOUT: !104 = !DILocalVariable(arg: 2, scope: !102, type: !7) -// CHECK:STDOUT: !107 = !DILocation(line: 27, column: 3, scope: !102) -// CHECK:STDOUT: !109 = !DILocation(line: 28, column: 3, scope: !102) -// CHECK:STDOUT: !111 = !DILocation(line: 29, column: 3, scope: !102) -// CHECK:STDOUT: !113 = !DILocation(line: 30, column: 3, scope: !102) -// CHECK:STDOUT: !115 = !DILocation(line: 26, column: 1, scope: !102) -// CHECK:STDOUT: !116 = !{!103, !104} -// CHECK:STDOUT: !117 = !{!"p1 _ZTS8OrderedA", !49, i64 0} -// CHECK:STDOUT: !118 = !{!117, !117, i64 0} -// CHECK:STDOUT: !119 = !{!"_ZTS8OrderedA", !55, i64 0} -// CHECK:STDOUT: !120 = !{!119, !55, i64 0} +// CHECK:STDOUT: !61 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !62 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !63 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !64 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !65 = !{!"__libc_errno", !55, i64 0} +// CHECK:STDOUT: !66 = !{!65, !55, i64 0} +// CHECK:STDOUT: !67 = !DIFile(filename: "ordered_with.carbon", directory: "") +// CHECK:STDOUT: !68 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !67, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !69 = distinct !DISubprogram(name: "Driver", linkageName: "_CDriver.Main", scope: null, file: !67, line: 33, type: !9, spFlags: DISPFlagDefinition, unit: !68, retainedNodes: !78) +// CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !69, type: !7) +// CHECK:STDOUT: !71 = !DILocalVariable(arg: 2, scope: !69, type: !7) +// CHECK:STDOUT: !76 = !DILocation(line: 34, column: 3, scope: !69) +// CHECK:STDOUT: !77 = !DILocation(line: 33, column: 1, scope: !69) +// CHECK:STDOUT: !78 = !{!70, !71} +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Less", linkageName: "_CLess:thunk:OrderedWith.f3924169c098de0f.Core:Cpp", scope: null, file: !67, line: 8, type: !13, spFlags: DISPFlagDefinition, unit: !68, retainedNodes: !84) +// CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !79, type: !7) +// CHECK:STDOUT: !81 = !DILocalVariable(arg: 2, scope: !79, type: !7) +// CHECK:STDOUT: !83 = !DILocation(line: 8, column: 15, scope: !79) +// CHECK:STDOUT: !84 = !{!80, !81} +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "LessOrEquivalent", linkageName: "_CLessOrEquivalent:thunk:OrderedWith.f3924169c098de0f.Core:Cpp", scope: null, file: !67, line: 16, type: !13, spFlags: DISPFlagDefinition, unit: !68, retainedNodes: !90) +// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !7) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 2, scope: !85, type: !7) +// CHECK:STDOUT: !89 = !DILocation(line: 16, column: 15, scope: !85) +// CHECK:STDOUT: !90 = !{!86, !87} +// CHECK:STDOUT: !91 = distinct !DISubprogram(name: "Greater", linkageName: "_CGreater:thunk:OrderedWith.f3924169c098de0f.Core:Cpp", scope: null, file: !67, line: 12, type: !13, spFlags: DISPFlagDefinition, unit: !68, retainedNodes: !96) +// CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !91, type: !7) +// CHECK:STDOUT: !93 = !DILocalVariable(arg: 2, scope: !91, type: !7) +// CHECK:STDOUT: !95 = !DILocation(line: 12, column: 15, scope: !91) +// CHECK:STDOUT: !96 = !{!92, !93} +// CHECK:STDOUT: !97 = distinct !DISubprogram(name: "GreaterOrEquivalent", linkageName: "_CGreaterOrEquivalent:thunk:OrderedWith.f3924169c098de0f.Core:Cpp", scope: null, file: !67, line: 20, type: !13, spFlags: DISPFlagDefinition, unit: !68, retainedNodes: !102) +// CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !97, type: !7) +// CHECK:STDOUT: !99 = !DILocalVariable(arg: 2, scope: !97, type: !7) +// CHECK:STDOUT: !101 = !DILocation(line: 20, column: 15, scope: !97) +// CHECK:STDOUT: !102 = !{!98, !99} +// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "CheckOrderedWith", linkageName: "_CCheckOrderedWith.Main.b948edeb3216062b", scope: null, file: !67, line: 26, type: !9, spFlags: DISPFlagDefinition, unit: !68, retainedNodes: !117) +// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !7) +// CHECK:STDOUT: !105 = !DILocalVariable(arg: 2, scope: !103, type: !7) +// CHECK:STDOUT: !108 = !DILocation(line: 27, column: 3, scope: !103) +// CHECK:STDOUT: !110 = !DILocation(line: 28, column: 3, scope: !103) +// CHECK:STDOUT: !112 = !DILocation(line: 29, column: 3, scope: !103) +// CHECK:STDOUT: !114 = !DILocation(line: 30, column: 3, scope: !103) +// CHECK:STDOUT: !116 = !DILocation(line: 26, column: 1, scope: !103) +// CHECK:STDOUT: !117 = !{!104, !105} +// CHECK:STDOUT: !118 = !{!"p1 _ZTS8OrderedA", !49, i64 0} +// CHECK:STDOUT: !119 = !{!118, !118, i64 0} +// CHECK:STDOUT: !120 = !{!"_ZTS8OrderedA", !55, i64 0} +// CHECK:STDOUT: !121 = !{!120, !55, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/pointer.carbon b/toolchain/lower/testdata/interop/cpp/pointer.carbon index 75a394401e69..eed0b92f4e71 100644 --- a/toolchain/lower/testdata/interop/cpp/pointer.carbon +++ b/toolchain/lower/testdata/interop/cpp/pointer.carbon @@ -168,8 +168,8 @@ fn Convert() { // CHECK:STDOUT: attributes #2 = { alwaysinline 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!45} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !43, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!46} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -201,12 +201,13 @@ fn Convert() { // CHECK:STDOUT: !37 = !{!"any pointer", !36, i64 0} // CHECK:STDOUT: !38 = !{!"p1 _ZTS8NonnullC", !37, i64 0} // CHECK:STDOUT: !39 = !{!38, !38, i64 0} -// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !43 = !{!"int", !36, i64 0} -// CHECK:STDOUT: !44 = !{!"__libc_errno", !43, i64 0} -// CHECK:STDOUT: !45 = !{!44, !43, i64 0} +// CHECK:STDOUT: !40 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !44 = !{!"int", !36, i64 0} +// CHECK:STDOUT: !45 = !{!"__libc_errno", !44, i64 0} +// CHECK:STDOUT: !46 = !{!45, !44, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'nullable.carbon' @@ -215,69 +216,69 @@ 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 !48 { +// CHECK:STDOUT: define void @_CPassPtr.Main(ptr %_) #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 void @_CPassNonnullPtr.Main(ptr %p) #0 !dbg !53 { +// CHECK:STDOUT: define void @_CPassNonnullPtr.Main(ptr %p) #0 !dbg !54 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc22_23.2.temp = alloca ptr, align 8, !dbg !56 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.4e9bbab1c7c88cc2"(ptr %p), !dbg !56 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.2.temp), !dbg !56 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_23.2.temp, align 8, !dbg !56 -// CHECK:STDOUT: %.loc22_23.4 = load ptr, ptr %.loc22_23.2.temp, align 8, !dbg !56 -// CHECK:STDOUT: call void @_Z15TakeNullablePtrP9NullableC(ptr %.loc22_23.4), !dbg !59 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.bbc536feb16fa006(ptr %.loc22_23.2.temp), !dbg !56 -// CHECK:STDOUT: ret void, !dbg !60 +// CHECK:STDOUT: %.loc22_23.2.temp = alloca ptr, align 8, !dbg !57 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.4e9bbab1c7c88cc2"(ptr %p), !dbg !57 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc22_23.2.temp), !dbg !57 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc22_23.2.temp, align 8, !dbg !57 +// CHECK:STDOUT: %.loc22_23.4 = load ptr, ptr %.loc22_23.2.temp, align 8, !dbg !57 +// CHECK:STDOUT: call void @_Z15TakeNullablePtrP9NullableC(ptr %.loc22_23.4), !dbg !60 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.bbc536feb16fa006(ptr %.loc22_23.2.temp), !dbg !57 +// CHECK:STDOUT: ret void, !dbg !61 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z15TakeNullablePtrP9NullableC(ptr noundef) #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !62 { +// CHECK:STDOUT: define ptr @_CReturnPtr.Main() #0 !dbg !63 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnNullablePtr.call = call ptr @_Z17ReturnNullablePtrv(), !dbg !65 -// CHECK:STDOUT: ret ptr %ReturnNullablePtr.call, !dbg !66 +// CHECK:STDOUT: %ReturnNullablePtr.call = call ptr @_Z17ReturnNullablePtrv(), !dbg !66 +// CHECK:STDOUT: ret ptr %ReturnNullablePtr.call, !dbg !67 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z17ReturnNullablePtrv() #1 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %_) #0 !dbg !67 { +// CHECK:STDOUT: define void @_CPassPtrWithThunk.Main(ptr %_) #0 !dbg !68 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret void, !dbg !70 +// CHECK:STDOUT: ret void, !dbg !71 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !72 { +// CHECK:STDOUT: define void @_CPassNonnullPtrWithThunk.Main(ptr %p) #0 !dbg !73 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc35_32.2.temp = alloca ptr, align 8, !dbg !75 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.4e9bbab1c7c88cc2"(ptr %p), !dbg !75 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_32.2.temp), !dbg !75 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_32.2.temp, align 8, !dbg !75 -// CHECK:STDOUT: %.loc35_32.4 = load ptr, ptr %.loc35_32.2.temp, align 8, !dbg !75 -// CHECK:STDOUT: call void @_Z24TakeNullablePtrWithThunkP9NullableCi.carbon_thunk._(ptr %.loc35_32.4), !dbg !76 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.bbc536feb16fa006(ptr %.loc35_32.2.temp), !dbg !75 -// CHECK:STDOUT: ret void, !dbg !77 +// CHECK:STDOUT: %.loc35_32.2.temp = alloca ptr, align 8, !dbg !76 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.4e9bbab1c7c88cc2"(ptr %p), !dbg !76 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc35_32.2.temp), !dbg !76 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc35_32.2.temp, align 8, !dbg !76 +// CHECK:STDOUT: %.loc35_32.4 = load ptr, ptr %.loc35_32.2.temp, align 8, !dbg !76 +// CHECK:STDOUT: call void @_Z24TakeNullablePtrWithThunkP9NullableCi.carbon_thunk._(ptr %.loc35_32.4), !dbg !77 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.bbc536feb16fa006(ptr %.loc35_32.2.temp), !dbg !76 +// CHECK:STDOUT: ret void, !dbg !78 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z24TakeNullablePtrWithThunkP9NullableCi.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 !139 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !139 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !140 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !140 // CHECK:STDOUT: call void @_Z24TakeNullablePtrWithThunkP9NullableCi(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 !79 { +// CHECK:STDOUT: define ptr @_CReturnPtrWithThunk.Main() #0 !dbg !80 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnNullablePtrWithThunk__carbon_thunk.call = call ptr @_Z26ReturnNullablePtrWithThunki.carbon_thunk.(), !dbg !82 -// CHECK:STDOUT: ret ptr %ReturnNullablePtrWithThunk__carbon_thunk.call, !dbg !83 +// CHECK:STDOUT: %ReturnNullablePtrWithThunk__carbon_thunk.call = call ptr @_Z26ReturnNullablePtrWithThunki.carbon_thunk.(), !dbg !83 +// CHECK:STDOUT: ret ptr %ReturnNullablePtrWithThunk__carbon_thunk.call, !dbg !84 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -288,45 +289,45 @@ fn Convert() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.4e9bbab1c7c88cc2"(ptr %self) #0 !dbg !85 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.059052cdc9a4441d"(ptr %self), !dbg !90 -// CHECK:STDOUT: ret ptr %1, !dbg !91 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.4e9bbab1c7c88cc2"(ptr %self) #0 !dbg !86 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.059052cdc9a4441d"(ptr %self), !dbg !91 +// CHECK:STDOUT: ret ptr %1, !dbg !92 // 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 @_CSelfDestruct.Core.bbc536feb16fa006(ptr %t) #0 !dbg !94 { -// CHECK:STDOUT: ret void, !dbg !99 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.bbc536feb16fa006(ptr %t) #0 !dbg !95 { +// CHECK:STDOUT: ret void, !dbg !100 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.059052cdc9a4441d"(ptr %self) #0 !dbg !101 { -// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.059052cdc9a4441d(ptr %self), !dbg !107 -// CHECK:STDOUT: ret ptr %1, !dbg !108 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.059052cdc9a4441d"(ptr %self) #0 !dbg !102 { +// CHECK:STDOUT: %1 = call ptr @_CSome.Optional.Core.059052cdc9a4441d(ptr %self), !dbg !108 +// CHECK:STDOUT: ret ptr %1, !dbg !109 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.059052cdc9a4441d(ptr %value) #0 !dbg !110 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %value), !dbg !115 -// CHECK:STDOUT: ret ptr %1, !dbg !116 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.059052cdc9a4441d(ptr %value) #0 !dbg !111 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %value), !dbg !116 +// CHECK:STDOUT: ret ptr %1, !dbg !117 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %self) #0 !dbg !118 { -// 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 !127 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !125 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.9abdc217755355a3(ptr %1), !dbg !123 -// CHECK:STDOUT: ret ptr %2, !dbg !129 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d"(ptr %self) #0 !dbg !119 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !124 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !124 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !124 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !128 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !126 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.9abdc217755355a3(ptr %1), !dbg !124 +// CHECK:STDOUT: ret ptr %2, !dbg !130 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.9abdc217755355a3(ptr %t) #0 !dbg !131 { -// CHECK:STDOUT: ret void, !dbg !136 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.9abdc217755355a3(ptr %t) #0 !dbg !132 { +// CHECK:STDOUT: ret void, !dbg !137 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z24TakeNullablePtrWithThunkP9NullableCi(ptr noundef, i32 noundef) #1 @@ -343,9 +344,9 @@ fn Convert() { // CHECK:STDOUT: attributes #2 = { alwaysinline 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" } // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!47} -// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!45} +// CHECK:STDOUT: !llvm.dbg.cu = !{!48} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !43, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!46} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -357,76 +358,77 @@ fn Convert() { // CHECK:STDOUT: !35 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !36 = !{!"omnipotent char", !35, i64 0} // CHECK:STDOUT: !37 = !{!"any pointer", !36, i64 0} -// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !43 = !{!"int", !36, i64 0} -// CHECK:STDOUT: !44 = !{!"__libc_errno", !43, i64 0} -// CHECK:STDOUT: !45 = !{!44, !43, i64 0} -// CHECK:STDOUT: !46 = !DIFile(filename: "nullable.carbon", directory: "") -// CHECK:STDOUT: !47 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !46, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !46, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !52) -// CHECK:STDOUT: !49 = !DILocalVariable(arg: 1, scope: !48, type: !6) -// CHECK:STDOUT: !51 = !DILocation(line: 14, column: 1, scope: !48) -// CHECK:STDOUT: !52 = !{!49} -// CHECK:STDOUT: !53 = distinct !DISubprogram(name: "PassNonnullPtr", linkageName: "_CPassNonnullPtr.Main", scope: null, file: !46, line: 19, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !61) -// CHECK:STDOUT: !54 = !DILocalVariable(arg: 1, scope: !53, type: !6) -// CHECK:STDOUT: !56 = !DILocation(line: 22, column: 23, scope: !53) -// CHECK:STDOUT: !57 = !{!6, !6} -// CHECK:STDOUT: !58 = !DISubroutineType(types: !57) -// CHECK:STDOUT: !59 = !DILocation(line: 22, column: 3, scope: !53) -// CHECK:STDOUT: !60 = !DILocation(line: 19, column: 1, scope: !53) -// CHECK:STDOUT: !61 = !{!54} -// CHECK:STDOUT: !62 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !46, line: 25, type: !10, spFlags: DISPFlagDefinition, unit: !47) -// CHECK:STDOUT: !65 = !DILocation(line: 26, column: 10, scope: !62) -// CHECK:STDOUT: !66 = !DILocation(line: 26, column: 3, scope: !62) -// CHECK:STDOUT: !67 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !46, line: 29, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !71) -// CHECK:STDOUT: !68 = !DILocalVariable(arg: 1, scope: !67, type: !6) -// CHECK:STDOUT: !70 = !DILocation(line: 29, column: 1, scope: !67) -// CHECK:STDOUT: !71 = !{!68} -// CHECK:STDOUT: !72 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !46, line: 34, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !78) -// CHECK:STDOUT: !73 = !DILocalVariable(arg: 1, scope: !72, type: !6) -// CHECK:STDOUT: !75 = !DILocation(line: 35, column: 32, scope: !72) -// CHECK:STDOUT: !76 = !DILocation(line: 35, column: 3, scope: !72) -// CHECK:STDOUT: !77 = !DILocation(line: 34, column: 1, scope: !72) -// CHECK:STDOUT: !78 = !{!73} -// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !46, line: 38, type: !10, spFlags: DISPFlagDefinition, unit: !47) -// CHECK:STDOUT: !82 = !DILocation(line: 39, column: 10, scope: !79) -// CHECK:STDOUT: !83 = !DILocation(line: 39, column: 3, scope: !79) -// CHECK:STDOUT: !84 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.4e9bbab1c7c88cc2", scope: null, file: !84, line: 105, type: !58, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !92) -// CHECK:STDOUT: !86 = !DILocalVariable(arg: 1, scope: !85, type: !6) -// CHECK:STDOUT: !90 = !DILocation(line: 106, column: 12, scope: !85) -// CHECK:STDOUT: !91 = !DILocation(line: 106, column: 5, scope: !85) -// CHECK:STDOUT: !92 = !{!86} -// CHECK:STDOUT: !93 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") -// CHECK:STDOUT: !94 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.bbc536feb16fa006", scope: null, file: !93, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !100) -// CHECK:STDOUT: !95 = !DILocalVariable(arg: 1, scope: !94, type: !6) -// CHECK:STDOUT: !99 = !DILocation(line: 36, column: 1, scope: !94) -// CHECK:STDOUT: !100 = !{!95} -// CHECK:STDOUT: !101 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.059052cdc9a4441d", scope: null, file: !84, line: 80, type: !58, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !109) -// CHECK:STDOUT: !102 = !DILocalVariable(arg: 1, scope: !101, type: !6) -// CHECK:STDOUT: !107 = !DILocation(line: 81, column: 12, scope: !101) -// CHECK:STDOUT: !108 = !DILocation(line: 81, column: 5, scope: !101) -// CHECK:STDOUT: !109 = !{!102} -// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.059052cdc9a4441d", scope: null, file: !84, line: 33, type: !58, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !117) -// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !6) -// CHECK:STDOUT: !115 = !DILocation(line: 34, column: 12, scope: !110) -// CHECK:STDOUT: !116 = !DILocation(line: 34, column: 5, scope: !110) -// CHECK:STDOUT: !117 = !{!111} -// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d", scope: null, file: !84, line: 166, type: !58, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !130) -// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !6) -// CHECK:STDOUT: !123 = !DILocation(line: 167, column: 14, scope: !118) -// CHECK:STDOUT: !125 = !DILocation(line: 167, column: 18, scope: !118) -// CHECK:STDOUT: !127 = !DILocation(line: 169, column: 5, scope: !118) -// CHECK:STDOUT: !129 = !DILocation(line: 170, column: 5, scope: !118) -// CHECK:STDOUT: !130 = !{!119} -// CHECK:STDOUT: !131 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.9abdc217755355a3", scope: null, file: !93, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !47, retainedNodes: !137) -// CHECK:STDOUT: !132 = !DILocalVariable(arg: 1, scope: !131, type: !6) -// CHECK:STDOUT: !136 = !DILocation(line: 36, column: 1, scope: !131) -// CHECK:STDOUT: !137 = !{!132} -// CHECK:STDOUT: !138 = !{!"p1 _ZTS9NullableC", !37, i64 0} -// CHECK:STDOUT: !139 = !{!138, !138, i64 0} +// CHECK:STDOUT: !40 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !44 = !{!"int", !36, i64 0} +// CHECK:STDOUT: !45 = !{!"__libc_errno", !44, i64 0} +// CHECK:STDOUT: !46 = !{!45, !44, i64 0} +// CHECK:STDOUT: !47 = !DIFile(filename: "nullable.carbon", directory: "") +// CHECK:STDOUT: !48 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !47, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !49 = distinct !DISubprogram(name: "PassPtr", linkageName: "_CPassPtr.Main", scope: null, file: !47, line: 14, type: !8, spFlags: DISPFlagDefinition, unit: !48, retainedNodes: !53) +// CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !49, type: !6) +// CHECK:STDOUT: !52 = !DILocation(line: 14, column: 1, scope: !49) +// CHECK:STDOUT: !53 = !{!50} +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "PassNonnullPtr", linkageName: "_CPassNonnullPtr.Main", scope: null, file: !47, line: 19, type: !8, spFlags: DISPFlagDefinition, unit: !48, retainedNodes: !62) +// CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !54, type: !6) +// CHECK:STDOUT: !57 = !DILocation(line: 22, column: 23, scope: !54) +// CHECK:STDOUT: !58 = !{!6, !6} +// CHECK:STDOUT: !59 = !DISubroutineType(types: !58) +// CHECK:STDOUT: !60 = !DILocation(line: 22, column: 3, scope: !54) +// CHECK:STDOUT: !61 = !DILocation(line: 19, column: 1, scope: !54) +// CHECK:STDOUT: !62 = !{!55} +// CHECK:STDOUT: !63 = distinct !DISubprogram(name: "ReturnPtr", linkageName: "_CReturnPtr.Main", scope: null, file: !47, line: 25, type: !10, spFlags: DISPFlagDefinition, unit: !48) +// CHECK:STDOUT: !66 = !DILocation(line: 26, column: 10, scope: !63) +// CHECK:STDOUT: !67 = !DILocation(line: 26, column: 3, scope: !63) +// CHECK:STDOUT: !68 = distinct !DISubprogram(name: "PassPtrWithThunk", linkageName: "_CPassPtrWithThunk.Main", scope: null, file: !47, line: 29, type: !8, spFlags: DISPFlagDefinition, unit: !48, retainedNodes: !72) +// CHECK:STDOUT: !69 = !DILocalVariable(arg: 1, scope: !68, type: !6) +// CHECK:STDOUT: !71 = !DILocation(line: 29, column: 1, scope: !68) +// CHECK:STDOUT: !72 = !{!69} +// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "PassNonnullPtrWithThunk", linkageName: "_CPassNonnullPtrWithThunk.Main", scope: null, file: !47, line: 34, type: !8, spFlags: DISPFlagDefinition, unit: !48, retainedNodes: !79) +// CHECK:STDOUT: !74 = !DILocalVariable(arg: 1, scope: !73, type: !6) +// CHECK:STDOUT: !76 = !DILocation(line: 35, column: 32, scope: !73) +// CHECK:STDOUT: !77 = !DILocation(line: 35, column: 3, scope: !73) +// CHECK:STDOUT: !78 = !DILocation(line: 34, column: 1, scope: !73) +// CHECK:STDOUT: !79 = !{!74} +// CHECK:STDOUT: !80 = distinct !DISubprogram(name: "ReturnPtrWithThunk", linkageName: "_CReturnPtrWithThunk.Main", scope: null, file: !47, line: 38, type: !10, spFlags: DISPFlagDefinition, unit: !48) +// CHECK:STDOUT: !83 = !DILocation(line: 39, column: 10, scope: !80) +// CHECK:STDOUT: !84 = !DILocation(line: 39, column: 3, scope: !80) +// CHECK:STDOUT: !85 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !86 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.4e9bbab1c7c88cc2", scope: null, file: !85, line: 105, type: !59, spFlags: DISPFlagDefinition, unit: !48, retainedNodes: !93) +// CHECK:STDOUT: !87 = !DILocalVariable(arg: 1, scope: !86, type: !6) +// CHECK:STDOUT: !91 = !DILocation(line: 106, column: 12, scope: !86) +// CHECK:STDOUT: !92 = !DILocation(line: 106, column: 5, scope: !86) +// CHECK:STDOUT: !93 = !{!87} +// CHECK:STDOUT: !94 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") +// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.bbc536feb16fa006", scope: null, file: !94, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !48, retainedNodes: !101) +// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !6) +// CHECK:STDOUT: !100 = !DILocation(line: 36, column: 1, scope: !95) +// CHECK:STDOUT: !101 = !{!96} +// CHECK:STDOUT: !102 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.9fdaf39d07a1dc4e:OptionalAs.24b7347a93330e68.Core.059052cdc9a4441d", scope: null, file: !85, line: 80, type: !59, spFlags: DISPFlagDefinition, unit: !48, retainedNodes: !110) +// CHECK:STDOUT: !103 = !DILocalVariable(arg: 1, scope: !102, type: !6) +// CHECK:STDOUT: !108 = !DILocation(line: 81, column: 12, scope: !102) +// CHECK:STDOUT: !109 = !DILocation(line: 81, column: 5, scope: !102) +// CHECK:STDOUT: !110 = !{!103} +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.059052cdc9a4441d", scope: null, file: !85, line: 33, type: !59, spFlags: DISPFlagDefinition, unit: !48, retainedNodes: !118) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !6) +// CHECK:STDOUT: !116 = !DILocation(line: 34, column: 12, scope: !111) +// CHECK:STDOUT: !117 = !DILocation(line: 34, column: 5, scope: !111) +// CHECK:STDOUT: !118 = !{!112} +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.77dd513e5db6ef8d", scope: null, file: !85, line: 166, type: !59, spFlags: DISPFlagDefinition, unit: !48, retainedNodes: !131) +// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !6) +// CHECK:STDOUT: !124 = !DILocation(line: 167, column: 14, scope: !119) +// CHECK:STDOUT: !126 = !DILocation(line: 167, column: 18, scope: !119) +// CHECK:STDOUT: !128 = !DILocation(line: 169, column: 5, scope: !119) +// CHECK:STDOUT: !130 = !DILocation(line: 170, column: 5, scope: !119) +// CHECK:STDOUT: !131 = !{!120} +// CHECK:STDOUT: !132 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.9abdc217755355a3", scope: null, file: !94, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !48, retainedNodes: !138) +// CHECK:STDOUT: !133 = !DILocalVariable(arg: 1, scope: !132, type: !6) +// CHECK:STDOUT: !137 = !DILocation(line: 36, column: 1, scope: !132) +// CHECK:STDOUT: !138 = !{!133} +// CHECK:STDOUT: !139 = !{!"p1 _ZTS9NullableC", !37, i64 0} +// CHECK:STDOUT: !140 = !{!139, !139, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'add_const.carbon' @@ -435,22 +437,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 !144 { +// CHECK:STDOUT: define void @_CConvert.Main() #0 !dbg !145 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc11_21.1.temp = alloca ptr, align 8, !dbg !145 -// CHECK:STDOUT: %.loc11_21.5.temp = alloca ptr, align 8, !dbg !145 -// CHECK:STDOUT: %make.call = call ptr @_Z4makev(), !dbg !145 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.1.temp), !dbg !145 -// CHECK:STDOUT: store ptr %make.call, ptr %.loc11_21.1.temp, align 8, !dbg !145 -// CHECK:STDOUT: %.loc11_21.3 = load ptr, ptr %.loc11_21.1.temp, align 8, !dbg !145 -// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.470ca455cde45499"(ptr %.loc11_21.3), !dbg !145 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.5.temp), !dbg !145 -// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.5.temp, align 8, !dbg !145 -// CHECK:STDOUT: %.loc11_21.7 = load ptr, ptr %.loc11_21.5.temp, align 8, !dbg !145 -// CHECK:STDOUT: call void @_Z4takePK6ConstC(ptr %.loc11_21.7), !dbg !146 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.55cdda357d448221(ptr %.loc11_21.5.temp), !dbg !145 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.63d1d3e401037503(ptr %.loc11_21.1.temp), !dbg !145 -// CHECK:STDOUT: ret void, !dbg !147 +// CHECK:STDOUT: %.loc11_21.1.temp = alloca ptr, align 8, !dbg !146 +// CHECK:STDOUT: %.loc11_21.5.temp = alloca ptr, align 8, !dbg !146 +// CHECK:STDOUT: %make.call = call ptr @_Z4makev(), !dbg !146 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.1.temp), !dbg !146 +// CHECK:STDOUT: store ptr %make.call, ptr %.loc11_21.1.temp, align 8, !dbg !146 +// CHECK:STDOUT: %.loc11_21.3 = load ptr, ptr %.loc11_21.1.temp, align 8, !dbg !146 +// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.470ca455cde45499"(ptr %.loc11_21.3), !dbg !146 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_21.5.temp), !dbg !146 +// CHECK:STDOUT: store ptr %U.as_type.as.ImplicitAs.impl.Convert.call, ptr %.loc11_21.5.temp, align 8, !dbg !146 +// CHECK:STDOUT: %.loc11_21.7 = load ptr, ptr %.loc11_21.5.temp, align 8, !dbg !146 +// CHECK:STDOUT: call void @_Z4takePK6ConstC(ptr %.loc11_21.7), !dbg !147 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.55cdda357d448221(ptr %.loc11_21.5.temp), !dbg !146 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.63d1d3e401037503(ptr %.loc11_21.1.temp), !dbg !146 +// CHECK:STDOUT: ret void, !dbg !148 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef ptr @_Z4makev() #1 @@ -461,105 +463,105 @@ fn Convert() { // 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.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.470ca455cde45499"(ptr %self) #0 !dbg !148 { -// CHECK:STDOUT: %1 = call ptr @"_CConvert.Optional.d1728a6b8ac984c6.Core:OptionalAs.5cc57aaa5e35eede.Core.397ceadf3cc9326d"(ptr %self), !dbg !153 -// CHECK:STDOUT: ret ptr %1, !dbg !154 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.470ca455cde45499"(ptr %self) #0 !dbg !149 { +// CHECK:STDOUT: %1 = call ptr @"_CConvert.Optional.d1728a6b8ac984c6.Core:OptionalAs.5cc57aaa5e35eede.Core.397ceadf3cc9326d"(ptr %self), !dbg !154 +// CHECK:STDOUT: ret ptr %1, !dbg !155 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.55cdda357d448221(ptr %t) #0 !dbg !156 { -// CHECK:STDOUT: ret void, !dbg !161 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.55cdda357d448221(ptr %t) #0 !dbg !157 { +// CHECK:STDOUT: ret void, !dbg !162 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.63d1d3e401037503(ptr %t) #0 !dbg !163 { -// CHECK:STDOUT: ret void, !dbg !168 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.63d1d3e401037503(ptr %t) #0 !dbg !164 { +// CHECK:STDOUT: ret void, !dbg !169 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.Optional.d1728a6b8ac984c6.Core:OptionalAs.5cc57aaa5e35eede.Core.397ceadf3cc9326d"(ptr %self) #0 !dbg !170 { -// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !177 -// CHECK:STDOUT: %temp1 = alloca ptr, align 8, !dbg !177 -// CHECK:STDOUT: %1 = call i1 @_CHasValue.Optional.Core.128f4c34f2ac2dc8(ptr %self), !dbg !175 -// CHECK:STDOUT: br i1 %1, label %2, label %7, !dbg !176 +// CHECK:STDOUT: define linkonce_odr ptr @"_CConvert.Optional.d1728a6b8ac984c6.Core:OptionalAs.5cc57aaa5e35eede.Core.397ceadf3cc9326d"(ptr %self) #0 !dbg !171 { +// CHECK:STDOUT: %temp = alloca ptr, align 8, !dbg !178 +// CHECK:STDOUT: %temp1 = alloca ptr, align 8, !dbg !178 +// CHECK:STDOUT: %1 = call i1 @_CHasValue.Optional.Core.128f4c34f2ac2dc8(ptr %self), !dbg !176 +// CHECK:STDOUT: br i1 %1, label %2, label %7, !dbg !177 // CHECK:STDOUT: // CHECK:STDOUT: 2: ; preds = %0 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !177 -// CHECK:STDOUT: %3 = call ptr @_CGet.Optional.Core.128f4c34f2ac2dc8(ptr %self), !dbg !177 -// CHECK:STDOUT: store ptr %3, ptr %temp, align 8, !dbg !177 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !177 -// CHECK:STDOUT: %4 = load ptr, ptr %temp, align 8, !dbg !177 -// CHECK:STDOUT: store ptr %4, ptr %temp1, align 8, !dbg !177 -// CHECK:STDOUT: %5 = load ptr, ptr %temp1, align 8, !dbg !177 -// CHECK:STDOUT: %6 = call ptr @_CSome.Optional.Core.1c39bd137e62c6ea(ptr %5), !dbg !178 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.c9c637f86feae476(ptr %temp1), !dbg !177 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.afe76cd75c1d6f19(ptr %temp), !dbg !177 -// CHECK:STDOUT: ret ptr %6, !dbg !179 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp), !dbg !178 +// CHECK:STDOUT: %3 = call ptr @_CGet.Optional.Core.128f4c34f2ac2dc8(ptr %self), !dbg !178 +// CHECK:STDOUT: store ptr %3, ptr %temp, align 8, !dbg !178 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %temp1), !dbg !178 +// CHECK:STDOUT: %4 = load ptr, ptr %temp, align 8, !dbg !178 +// CHECK:STDOUT: store ptr %4, ptr %temp1, align 8, !dbg !178 +// CHECK:STDOUT: %5 = load ptr, ptr %temp1, align 8, !dbg !178 +// CHECK:STDOUT: %6 = call ptr @_CSome.Optional.Core.1c39bd137e62c6ea(ptr %5), !dbg !179 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.c9c637f86feae476(ptr %temp1), !dbg !178 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.afe76cd75c1d6f19(ptr %temp), !dbg !178 +// CHECK:STDOUT: ret ptr %6, !dbg !180 // CHECK:STDOUT: // CHECK:STDOUT: 7: ; preds = %0 -// CHECK:STDOUT: %8 = call ptr @_CNone.Optional.Core.1c39bd137e62c6ea(), !dbg !180 -// CHECK:STDOUT: ret ptr %8, !dbg !181 +// CHECK:STDOUT: %8 = call ptr @_CNone.Optional.Core.1c39bd137e62c6ea(), !dbg !181 +// CHECK:STDOUT: ret ptr %8, !dbg !182 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.128f4c34f2ac2dc8(ptr %self) #0 !dbg !183 { -// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !189 -// CHECK:STDOUT: ret i1 %1, !dbg !190 +// CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.128f4c34f2ac2dc8(ptr %self) #0 !dbg !184 { +// CHECK:STDOUT: %1 = call i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !190 +// CHECK:STDOUT: ret i1 %1, !dbg !191 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.128f4c34f2ac2dc8(ptr %self) #0 !dbg !192 { -// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !198 -// CHECK:STDOUT: ret ptr %1, !dbg !199 +// CHECK:STDOUT: define linkonce_odr ptr @_CGet.Optional.Core.128f4c34f2ac2dc8(ptr %self) #0 !dbg !193 { +// CHECK:STDOUT: %1 = call ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %self), !dbg !199 +// CHECK:STDOUT: ret ptr %1, !dbg !200 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.1c39bd137e62c6ea(ptr %value) #0 !dbg !201 { -// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %value), !dbg !206 -// CHECK:STDOUT: ret ptr %1, !dbg !207 +// CHECK:STDOUT: define linkonce_odr ptr @_CSome.Optional.Core.1c39bd137e62c6ea(ptr %value) #0 !dbg !202 { +// CHECK:STDOUT: %1 = call ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %value), !dbg !207 +// CHECK:STDOUT: ret ptr %1, !dbg !208 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.c9c637f86feae476(ptr %t) #0 !dbg !209 { -// CHECK:STDOUT: ret void, !dbg !214 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.c9c637f86feae476(ptr %t) #0 !dbg !210 { +// CHECK:STDOUT: ret void, !dbg !215 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.afe76cd75c1d6f19(ptr %t) #0 !dbg !216 { -// CHECK:STDOUT: ret void, !dbg !221 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.afe76cd75c1d6f19(ptr %t) #0 !dbg !217 { +// CHECK:STDOUT: ret void, !dbg !222 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.1c39bd137e62c6ea() #0 !dbg !223 { -// CHECK:STDOUT: ret ptr null, !dbg !227 +// CHECK:STDOUT: define linkonce_odr ptr @_CNone.Optional.Core.1c39bd137e62c6ea() #0 !dbg !224 { +// CHECK:STDOUT: ret ptr null, !dbg !228 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !228 { -// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !234 -// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !235 -// CHECK:STDOUT: ret i1 %2, !dbg !236 +// CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !229 { +// CHECK:STDOUT: %1 = icmp eq ptr %value, null, !dbg !235 +// CHECK:STDOUT: %2 = xor i1 %1, true, !dbg !236 +// CHECK:STDOUT: ret i1 %2, !dbg !237 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !238 { -// CHECK:STDOUT: ret ptr %value, !dbg !244 +// CHECK:STDOUT: define linkonce_odr ptr @"_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4"(ptr %value) #0 !dbg !239 { +// CHECK:STDOUT: ret ptr %value, !dbg !245 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %self) #0 !dbg !246 { -// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !251 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !251 -// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !251 -// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !255 -// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !253 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.4d5bd971f411a76b(ptr %1), !dbg !251 -// CHECK:STDOUT: ret ptr %2, !dbg !257 +// CHECK:STDOUT: define linkonce_odr ptr @"_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352"(ptr %self) #0 !dbg !247 { +// CHECK:STDOUT: %1 = alloca ptr, align 8, !dbg !252 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !252 +// CHECK:STDOUT: store ptr poison, ptr %1, align 8, !dbg !252 +// CHECK:STDOUT: store ptr %self, ptr %1, align 8, !dbg !256 +// CHECK:STDOUT: %2 = load ptr, ptr %1, align 8, !dbg !254 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.4d5bd971f411a76b(ptr %1), !dbg !252 +// CHECK:STDOUT: ret ptr %2, !dbg !258 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.4d5bd971f411a76b(ptr %t) #0 !dbg !259 { -// CHECK:STDOUT: ret void, !dbg !264 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.4d5bd971f411a76b(ptr %t) #0 !dbg !260 { +// CHECK:STDOUT: ret void, !dbg !265 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives @@ -569,9 +571,9 @@ fn Convert() { // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!141} -// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!45} +// CHECK:STDOUT: !llvm.dbg.cu = !{!142} +// CHECK:STDOUT: !llvm.module.flags = !{!40, !41, !42, !43, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!46} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -582,91 +584,92 @@ fn Convert() { // CHECK:STDOUT: !10 = !DISubroutineType(types: !9) // CHECK:STDOUT: !35 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !36 = !{!"omnipotent char", !35, i64 0} -// CHECK:STDOUT: !40 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !41 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !42 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !43 = !{!"int", !36, i64 0} -// CHECK:STDOUT: !44 = !{!"__libc_errno", !43, i64 0} -// CHECK:STDOUT: !45 = !{!44, !43, i64 0} -// CHECK:STDOUT: !57 = !{!6, !6} -// CHECK:STDOUT: !58 = !DISubroutineType(types: !57) -// CHECK:STDOUT: !84 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") -// CHECK:STDOUT: !93 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") -// CHECK:STDOUT: !140 = !DIFile(filename: "add_const.carbon", directory: "") -// CHECK:STDOUT: !141 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !140, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !142 = !{null} -// CHECK:STDOUT: !143 = !DISubroutineType(types: !142) -// CHECK:STDOUT: !144 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !140, line: 10, type: !143, spFlags: DISPFlagDefinition, unit: !141) -// CHECK:STDOUT: !145 = !DILocation(line: 11, column: 12, scope: !144) -// CHECK:STDOUT: !146 = !DILocation(line: 11, column: 3, scope: !144) -// CHECK:STDOUT: !147 = !DILocation(line: 10, column: 1, scope: !144) -// CHECK:STDOUT: !148 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.470ca455cde45499", scope: null, file: !84, line: 105, type: !58, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !155) -// CHECK:STDOUT: !149 = !DILocalVariable(arg: 1, scope: !148, type: !6) -// CHECK:STDOUT: !153 = !DILocation(line: 106, column: 12, scope: !148) -// CHECK:STDOUT: !154 = !DILocation(line: 106, column: 5, scope: !148) -// CHECK:STDOUT: !155 = !{!149} -// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.55cdda357d448221", scope: null, file: !93, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !162) -// CHECK:STDOUT: !157 = !DILocalVariable(arg: 1, scope: !156, type: !6) -// CHECK:STDOUT: !161 = !DILocation(line: 36, column: 1, scope: !156) -// CHECK:STDOUT: !162 = !{!157} -// CHECK:STDOUT: !163 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.63d1d3e401037503", scope: null, file: !93, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !169) -// CHECK:STDOUT: !164 = !DILocalVariable(arg: 1, scope: !163, type: !6) -// CHECK:STDOUT: !168 = !DILocation(line: 36, column: 1, scope: !163) -// CHECK:STDOUT: !169 = !{!164} -// CHECK:STDOUT: !170 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Optional.d1728a6b8ac984c6.Core:OptionalAs.5cc57aaa5e35eede.Core.397ceadf3cc9326d", scope: null, file: !84, line: 95, type: !58, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !182) -// CHECK:STDOUT: !171 = !DILocalVariable(arg: 1, scope: !170, type: !6) -// CHECK:STDOUT: !175 = !DILocation(line: 96, column: 9, scope: !170) -// CHECK:STDOUT: !176 = !DILocation(line: 96, column: 8, scope: !170) -// CHECK:STDOUT: !177 = !DILocation(line: 97, column: 31, scope: !170) -// CHECK:STDOUT: !178 = !DILocation(line: 97, column: 14, scope: !170) -// CHECK:STDOUT: !179 = !DILocation(line: 97, column: 7, scope: !170) -// CHECK:STDOUT: !180 = !DILocation(line: 99, column: 12, scope: !170) -// CHECK:STDOUT: !181 = !DILocation(line: 99, column: 5, scope: !170) -// CHECK:STDOUT: !182 = !{!171} -// CHECK:STDOUT: !183 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.128f4c34f2ac2dc8", scope: null, file: !84, line: 36, type: !58, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !191) -// CHECK:STDOUT: !184 = !DILocalVariable(arg: 1, scope: !183, type: !6) -// CHECK:STDOUT: !189 = !DILocation(line: 37, column: 12, scope: !183) -// CHECK:STDOUT: !190 = !DILocation(line: 37, column: 5, scope: !183) -// CHECK:STDOUT: !191 = !{!184} -// CHECK:STDOUT: !192 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.128f4c34f2ac2dc8", scope: null, file: !84, line: 39, type: !58, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !200) -// CHECK:STDOUT: !193 = !DILocalVariable(arg: 1, scope: !192, type: !6) -// CHECK:STDOUT: !198 = !DILocation(line: 40, column: 12, scope: !192) -// CHECK:STDOUT: !199 = !DILocation(line: 40, column: 5, scope: !192) -// CHECK:STDOUT: !200 = !{!193} -// CHECK:STDOUT: !201 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.1c39bd137e62c6ea", scope: null, file: !84, line: 33, type: !58, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !208) -// CHECK:STDOUT: !202 = !DILocalVariable(arg: 1, scope: !201, type: !6) -// CHECK:STDOUT: !206 = !DILocation(line: 34, column: 12, scope: !201) -// CHECK:STDOUT: !207 = !DILocation(line: 34, column: 5, scope: !201) -// CHECK:STDOUT: !208 = !{!202} -// CHECK:STDOUT: !209 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.c9c637f86feae476", scope: null, file: !93, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !215) -// CHECK:STDOUT: !210 = !DILocalVariable(arg: 1, scope: !209, type: !6) -// CHECK:STDOUT: !214 = !DILocation(line: 36, column: 1, scope: !209) -// CHECK:STDOUT: !215 = !{!210} -// CHECK:STDOUT: !216 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.afe76cd75c1d6f19", scope: null, file: !93, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !222) -// CHECK:STDOUT: !217 = !DILocalVariable(arg: 1, scope: !216, type: !6) -// CHECK:STDOUT: !221 = !DILocation(line: 36, column: 1, scope: !216) -// CHECK:STDOUT: !222 = !{!217} -// CHECK:STDOUT: !223 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.1c39bd137e62c6ea", scope: null, file: !84, line: 30, type: !10, spFlags: DISPFlagDefinition, unit: !141) -// CHECK:STDOUT: !227 = !DILocation(line: 31, column: 5, scope: !223) -// CHECK:STDOUT: !228 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !84, line: 172, type: !58, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !237) -// CHECK:STDOUT: !229 = !DILocalVariable(arg: 1, scope: !228, type: !6) -// CHECK:STDOUT: !234 = !DILocation(line: 173, column: 16, scope: !228) -// CHECK:STDOUT: !235 = !DILocation(line: 173, column: 12, scope: !228) -// CHECK:STDOUT: !236 = !DILocation(line: 173, column: 5, scope: !228) -// CHECK:STDOUT: !237 = !{!229} -// CHECK:STDOUT: !238 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !84, line: 175, type: !58, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !245) -// CHECK:STDOUT: !239 = !DILocalVariable(arg: 1, scope: !238, type: !6) -// CHECK:STDOUT: !244 = !DILocation(line: 176, column: 5, scope: !238) -// CHECK:STDOUT: !245 = !{!239} -// CHECK:STDOUT: !246 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352", scope: null, file: !84, line: 166, type: !58, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !258) -// CHECK:STDOUT: !247 = !DILocalVariable(arg: 1, scope: !246, type: !6) -// CHECK:STDOUT: !251 = !DILocation(line: 167, column: 14, scope: !246) -// CHECK:STDOUT: !253 = !DILocation(line: 167, column: 18, scope: !246) -// CHECK:STDOUT: !255 = !DILocation(line: 169, column: 5, scope: !246) -// CHECK:STDOUT: !257 = !DILocation(line: 170, column: 5, scope: !246) -// CHECK:STDOUT: !258 = !{!247} -// CHECK:STDOUT: !259 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.4d5bd971f411a76b", scope: null, file: !93, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !141, retainedNodes: !265) -// CHECK:STDOUT: !260 = !DILocalVariable(arg: 1, scope: !259, type: !6) -// CHECK:STDOUT: !264 = !DILocation(line: 36, column: 1, scope: !259) -// CHECK:STDOUT: !265 = !{!260} +// CHECK:STDOUT: !40 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !41 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !42 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !43 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !44 = !{!"int", !36, i64 0} +// CHECK:STDOUT: !45 = !{!"__libc_errno", !44, i64 0} +// CHECK:STDOUT: !46 = !{!45, !44, i64 0} +// CHECK:STDOUT: !58 = !{!6, !6} +// CHECK:STDOUT: !59 = !DISubroutineType(types: !58) +// CHECK:STDOUT: !85 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "") +// CHECK:STDOUT: !94 = !DIFile(filename: "{{.*}}/prelude/destroy.carbon", directory: "") +// CHECK:STDOUT: !141 = !DIFile(filename: "add_const.carbon", directory: "") +// CHECK:STDOUT: !142 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !141, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !143 = !{null} +// CHECK:STDOUT: !144 = !DISubroutineType(types: !143) +// CHECK:STDOUT: !145 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !141, line: 10, type: !144, spFlags: DISPFlagDefinition, unit: !142) +// CHECK:STDOUT: !146 = !DILocation(line: 11, column: 12, scope: !145) +// CHECK:STDOUT: !147 = !DILocation(line: 11, column: 3, scope: !145) +// CHECK:STDOUT: !148 = !DILocation(line: 10, column: 1, scope: !145) +// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.ea416314509b9f57:ImplicitAs.1863e1559591c4e5.Core.470ca455cde45499", scope: null, file: !85, line: 105, type: !59, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !156) +// CHECK:STDOUT: !150 = !DILocalVariable(arg: 1, scope: !149, type: !6) +// CHECK:STDOUT: !154 = !DILocation(line: 106, column: 12, scope: !149) +// CHECK:STDOUT: !155 = !DILocation(line: 106, column: 5, scope: !149) +// CHECK:STDOUT: !156 = !{!150} +// CHECK:STDOUT: !157 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.55cdda357d448221", scope: null, file: !94, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !163) +// CHECK:STDOUT: !158 = !DILocalVariable(arg: 1, scope: !157, type: !6) +// CHECK:STDOUT: !162 = !DILocation(line: 36, column: 1, scope: !157) +// CHECK:STDOUT: !163 = !{!158} +// CHECK:STDOUT: !164 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.63d1d3e401037503", scope: null, file: !94, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !170) +// CHECK:STDOUT: !165 = !DILocalVariable(arg: 1, scope: !164, type: !6) +// CHECK:STDOUT: !169 = !DILocation(line: 36, column: 1, scope: !164) +// CHECK:STDOUT: !170 = !{!165} +// CHECK:STDOUT: !171 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Optional.d1728a6b8ac984c6.Core:OptionalAs.5cc57aaa5e35eede.Core.397ceadf3cc9326d", scope: null, file: !85, line: 95, type: !59, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !183) +// CHECK:STDOUT: !172 = !DILocalVariable(arg: 1, scope: !171, type: !6) +// CHECK:STDOUT: !176 = !DILocation(line: 96, column: 9, scope: !171) +// CHECK:STDOUT: !177 = !DILocation(line: 96, column: 8, scope: !171) +// CHECK:STDOUT: !178 = !DILocation(line: 97, column: 31, scope: !171) +// CHECK:STDOUT: !179 = !DILocation(line: 97, column: 14, scope: !171) +// CHECK:STDOUT: !180 = !DILocation(line: 97, column: 7, scope: !171) +// CHECK:STDOUT: !181 = !DILocation(line: 99, column: 12, scope: !171) +// CHECK:STDOUT: !182 = !DILocation(line: 99, column: 5, scope: !171) +// CHECK:STDOUT: !183 = !{!172} +// CHECK:STDOUT: !184 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.128f4c34f2ac2dc8", scope: null, file: !85, line: 36, type: !59, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !192) +// CHECK:STDOUT: !185 = !DILocalVariable(arg: 1, scope: !184, type: !6) +// CHECK:STDOUT: !190 = !DILocation(line: 37, column: 12, scope: !184) +// CHECK:STDOUT: !191 = !DILocation(line: 37, column: 5, scope: !184) +// CHECK:STDOUT: !192 = !{!185} +// CHECK:STDOUT: !193 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.128f4c34f2ac2dc8", scope: null, file: !85, line: 39, type: !59, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !201) +// CHECK:STDOUT: !194 = !DILocalVariable(arg: 1, scope: !193, type: !6) +// CHECK:STDOUT: !199 = !DILocation(line: 40, column: 12, scope: !193) +// CHECK:STDOUT: !200 = !DILocation(line: 40, column: 5, scope: !193) +// CHECK:STDOUT: !201 = !{!194} +// CHECK:STDOUT: !202 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.1c39bd137e62c6ea", scope: null, file: !85, line: 33, type: !59, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !209) +// CHECK:STDOUT: !203 = !DILocalVariable(arg: 1, scope: !202, type: !6) +// CHECK:STDOUT: !207 = !DILocation(line: 34, column: 12, scope: !202) +// CHECK:STDOUT: !208 = !DILocation(line: 34, column: 5, scope: !202) +// CHECK:STDOUT: !209 = !{!203} +// CHECK:STDOUT: !210 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.c9c637f86feae476", scope: null, file: !94, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !216) +// CHECK:STDOUT: !211 = !DILocalVariable(arg: 1, scope: !210, type: !6) +// CHECK:STDOUT: !215 = !DILocation(line: 36, column: 1, scope: !210) +// CHECK:STDOUT: !216 = !{!211} +// CHECK:STDOUT: !217 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.afe76cd75c1d6f19", scope: null, file: !94, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !223) +// CHECK:STDOUT: !218 = !DILocalVariable(arg: 1, scope: !217, type: !6) +// CHECK:STDOUT: !222 = !DILocation(line: 36, column: 1, scope: !217) +// CHECK:STDOUT: !223 = !{!218} +// CHECK:STDOUT: !224 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.1c39bd137e62c6ea", scope: null, file: !85, line: 30, type: !10, spFlags: DISPFlagDefinition, unit: !142) +// CHECK:STDOUT: !228 = !DILocation(line: 31, column: 5, scope: !224) +// CHECK:STDOUT: !229 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !85, line: 172, type: !59, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !238) +// CHECK:STDOUT: !230 = !DILocalVariable(arg: 1, scope: !229, type: !6) +// CHECK:STDOUT: !235 = !DILocation(line: 173, column: 16, scope: !229) +// CHECK:STDOUT: !236 = !DILocation(line: 173, column: 12, scope: !229) +// CHECK:STDOUT: !237 = !DILocation(line: 173, column: 5, scope: !229) +// CHECK:STDOUT: !238 = !{!230} +// CHECK:STDOUT: !239 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e8f8f92d3d08d149:OptionalStorage.Core.21c65d90918a10a4", scope: null, file: !85, line: 175, type: !59, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !246) +// CHECK:STDOUT: !240 = !DILocalVariable(arg: 1, scope: !239, type: !6) +// CHECK:STDOUT: !245 = !DILocation(line: 176, column: 5, scope: !239) +// CHECK:STDOUT: !246 = !{!240} +// CHECK:STDOUT: !247 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e8f8f92d3d08d149:OptionalStorage.Core.35c29317da7de352", scope: null, file: !85, line: 166, type: !59, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !259) +// CHECK:STDOUT: !248 = !DILocalVariable(arg: 1, scope: !247, type: !6) +// CHECK:STDOUT: !252 = !DILocation(line: 167, column: 14, scope: !247) +// CHECK:STDOUT: !254 = !DILocation(line: 167, column: 18, scope: !247) +// CHECK:STDOUT: !256 = !DILocation(line: 169, column: 5, scope: !247) +// CHECK:STDOUT: !258 = !DILocation(line: 170, column: 5, scope: !247) +// CHECK:STDOUT: !259 = !{!248} +// CHECK:STDOUT: !260 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.4d5bd971f411a76b", scope: null, file: !94, line: 36, type: !8, spFlags: DISPFlagDefinition, unit: !142, retainedNodes: !266) +// CHECK:STDOUT: !261 = !DILocalVariable(arg: 1, scope: !260, type: !6) +// CHECK:STDOUT: !265 = !DILocation(line: 36, column: 1, scope: !260) +// CHECK:STDOUT: !266 = !{!261} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/reference.carbon b/toolchain/lower/testdata/interop/cpp/reference.carbon index d05ea5c7dfef..17a8f612e74f 100644 --- a/toolchain/lower/testdata/interop/cpp/reference.carbon +++ b/toolchain/lower/testdata/interop/cpp/reference.carbon @@ -272,8 +272,8 @@ fn GetRefs() { // CHECK:STDOUT: attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!81, !82, !83, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!85} +// CHECK:STDOUT: !llvm.module.flags = !{!81, !82, !83, !84, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!86} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -325,11 +325,12 @@ fn GetRefs() { // CHECK:STDOUT: !78 = !{!"int", !73, i64 0} // CHECK:STDOUT: !79 = !{!"p1 int", !74, i64 0} // CHECK:STDOUT: !80 = !{!79, !79, i64 0} -// CHECK:STDOUT: !81 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !82 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !83 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !84 = !{!"__libc_errno", !78, i64 0} -// CHECK:STDOUT: !85 = !{!84, !78, i64 0} +// CHECK:STDOUT: !81 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !82 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !83 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !84 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !85 = !{!"__libc_errno", !78, i64 0} +// CHECK:STDOUT: !86 = !{!85, !78, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'pass_references_via_thunk.carbon' @@ -343,35 +344,35 @@ 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 !88 { +// CHECK:STDOUT: define void @_CPassRefs.Main() #0 !dbg !89 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !89 -// CHECK:STDOUT: %.loc20_18.2.temp = alloca {}, align 1, !dbg !94 -// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !98 -// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !103 -// CHECK:STDOUT: %.loc26_23.2.temp = alloca i32, align 4, !dbg !105 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !89 -// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %c.var), !dbg !89 -// CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk.r(ptr %c.var), !dbg !93 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_18.2.temp), !dbg !94 -// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk._(ptr @C.val.loc20_20.3), !dbg !95 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr @C.val), !dbg !94 -// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk._(ptr %c.var), !dbg !97 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !98 -// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !98 -// CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk.r(ptr %n.var), !dbg !102 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !103 -// CHECK:STDOUT: store i32 42, ptr %_.var, align 4, !dbg !103 -// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk.v(ptr %_.var), !dbg !104 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %_.var), !dbg !103 -// CHECK:STDOUT: %.loc26_23.1 = load i32, ptr %n.var, align 4, !dbg !105 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_23.2.temp), !dbg !105 -// CHECK:STDOUT: store i32 %.loc26_23.1, ptr %.loc26_23.2.temp, align 4, !dbg !105 -// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk._(ptr %.loc26_23.2.temp), !dbg !106 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc26_23.2.temp), !dbg !105 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %n.var), !dbg !98 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %c.var), !dbg !89 -// CHECK:STDOUT: ret void, !dbg !107 +// CHECK:STDOUT: %c.var = alloca {}, align 1, !dbg !90 +// CHECK:STDOUT: %.loc20_18.2.temp = alloca {}, align 1, !dbg !95 +// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !99 +// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !104 +// CHECK:STDOUT: %.loc26_23.2.temp = alloca i32, align 4, !dbg !106 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !90 +// CHECK:STDOUT: call void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr %c.var), !dbg !90 +// CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk.carbon_thunk.r(ptr %c.var), !dbg !94 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_18.2.temp), !dbg !95 +// CHECK:STDOUT: call void @_Z9TakeCRRefRK1C10ForceThunk.carbon_thunk._(ptr @C.val.loc20_20.3), !dbg !96 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr @C.val), !dbg !95 +// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C10ForceThunk.carbon_thunk._(ptr %c.var), !dbg !98 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !99 +// CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !99 +// CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk.r(ptr %n.var), !dbg !103 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !104 +// CHECK:STDOUT: store i32 42, ptr %_.var, align 4, !dbg !104 +// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk.v(ptr %_.var), !dbg !105 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %_.var), !dbg !104 +// CHECK:STDOUT: %.loc26_23.1 = load i32, ptr %n.var, align 4, !dbg !106 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_23.2.temp), !dbg !106 +// CHECK:STDOUT: store i32 %.loc26_23.1, ptr %.loc26_23.2.temp, align 4, !dbg !106 +// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk._(ptr %.loc26_23.2.temp), !dbg !107 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %.loc26_23.2.temp), !dbg !106 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.f127f30143696d51(ptr %n.var), !dbg !99 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %c.var), !dbg !90 +// CHECK:STDOUT: ret void, !dbg !108 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable @@ -384,10 +385,10 @@ fn GetRefs() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind -// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret({}) %return) #2 !dbg !108 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr sret({}) %return) #2 !dbg !109 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !110 -// CHECK:STDOUT: ret void, !dbg !110 +// CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk.(ptr %return), !dbg !111 +// CHECK:STDOUT: ret void, !dbg !111 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -396,7 +397,7 @@ fn GetRefs() { // 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 !76 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !76, !nonnull !130 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !76, !nonnull !131 // CHECK:STDOUT: call void @_Z8TakeCRefR1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -429,7 +430,7 @@ fn GetRefs() { // 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 !80 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !80, !nonnull !130, !align !132 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !80, !nonnull !131, !align !133 // CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk(ptr noundef nonnull align 4 dereferenceable(4) %1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -460,19 +461,19 @@ fn GetRefs() { // 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 !111 { -// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !114 -// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: define linkonce_odr void @"_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c"(ptr sret({}) %return) #0 !dbg !112 { +// CHECK:STDOUT: call void @"_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp"(ptr %return), !dbg !115 +// CHECK:STDOUT: ret void, !dbg !116 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %t) #0 !dbg !116 { -// CHECK:STDOUT: ret void, !dbg !121 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.4d2f117a5a2332f0(ptr %t) #0 !dbg !117 { +// CHECK:STDOUT: ret void, !dbg !122 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #0 !dbg !123 { -// CHECK:STDOUT: ret void, !dbg !128 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.f127f30143696d51(ptr %t) #0 !dbg !124 { +// CHECK:STDOUT: ret void, !dbg !129 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z8TakeCRefR1C10ForceThunk(ptr noundef nonnull align 1 dereferenceable(1)) #5 @@ -499,9 +500,9 @@ fn GetRefs() { // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #5 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!87} -// CHECK:STDOUT: !llvm.module.flags = !{!81, !82, !83, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!85} +// CHECK:STDOUT: !llvm.dbg.cu = !{!88} +// CHECK:STDOUT: !llvm.module.flags = !{!81, !82, !83, !84, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!86} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -525,41 +526,42 @@ fn GetRefs() { // CHECK:STDOUT: !78 = !{!"int", !73, i64 0} // CHECK:STDOUT: !79 = !{!"p1 int", !74, i64 0} // CHECK:STDOUT: !80 = !{!79, !79, i64 0} -// CHECK:STDOUT: !81 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !82 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !83 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !84 = !{!"__libc_errno", !78, i64 0} -// CHECK:STDOUT: !85 = !{!84, !78, i64 0} -// CHECK:STDOUT: !86 = !DIFile(filename: "pass_references_via_thunk.carbon", directory: "") -// CHECK:STDOUT: !87 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !86, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !88 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !86, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !87) -// CHECK:STDOUT: !89 = !DILocation(line: 18, column: 3, scope: !88) -// CHECK:STDOUT: !93 = !DILocation(line: 19, column: 3, scope: !88) -// CHECK:STDOUT: !94 = !DILocation(line: 20, column: 17, scope: !88) -// CHECK:STDOUT: !95 = !DILocation(line: 20, column: 3, scope: !88) -// CHECK:STDOUT: !97 = !DILocation(line: 21, column: 3, scope: !88) -// CHECK:STDOUT: !98 = !DILocation(line: 23, column: 3, scope: !88) -// CHECK:STDOUT: !102 = !DILocation(line: 24, column: 3, scope: !88) -// CHECK:STDOUT: !103 = !DILocation(line: 13, column: 23, scope: !88) -// CHECK:STDOUT: !104 = !DILocation(line: 25, column: 3, scope: !88) -// CHECK:STDOUT: !105 = !DILocation(line: 26, column: 23, scope: !88) -// CHECK:STDOUT: !106 = !DILocation(line: 26, column: 3, scope: !88) -// CHECK:STDOUT: !107 = !DILocation(line: 17, column: 1, scope: !88) -// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !86, line: 5, type: !27, spFlags: DISPFlagDefinition, unit: !87) -// CHECK:STDOUT: !110 = !DILocation(line: 5, column: 7, scope: !108) -// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !4, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !87) -// CHECK:STDOUT: !114 = !DILocation(line: 9, column: 28, scope: !111) -// CHECK:STDOUT: !115 = !DILocation(line: 9, column: 21, scope: !111) -// CHECK:STDOUT: !116 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.4d2f117a5a2332f0", scope: null, file: !10, line: 32, type: !25, spFlags: DISPFlagDefinition, unit: !87, retainedNodes: !122) -// CHECK:STDOUT: !117 = !DILocalVariable(arg: 1, scope: !116, type: !23) -// CHECK:STDOUT: !121 = !DILocation(line: 32, column: 1, scope: !116) -// CHECK:STDOUT: !122 = !{!117} -// CHECK:STDOUT: !123 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !10, line: 32, type: !29, spFlags: DISPFlagDefinition, unit: !87, retainedNodes: !129) -// CHECK:STDOUT: !124 = !DILocalVariable(arg: 1, scope: !123, type: !20) -// CHECK:STDOUT: !128 = !DILocation(line: 32, column: 1, scope: !123) -// CHECK:STDOUT: !129 = !{!124} -// CHECK:STDOUT: !130 = !{} -// CHECK:STDOUT: !132 = !{i64 4} +// CHECK:STDOUT: !81 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !82 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !83 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !84 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !85 = !{!"__libc_errno", !78, i64 0} +// CHECK:STDOUT: !86 = !{!85, !78, i64 0} +// CHECK:STDOUT: !87 = !DIFile(filename: "pass_references_via_thunk.carbon", directory: "") +// CHECK:STDOUT: !88 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !87, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !89 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !87, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !88) +// CHECK:STDOUT: !90 = !DILocation(line: 18, column: 3, scope: !89) +// CHECK:STDOUT: !94 = !DILocation(line: 19, column: 3, scope: !89) +// CHECK:STDOUT: !95 = !DILocation(line: 20, column: 17, scope: !89) +// CHECK:STDOUT: !96 = !DILocation(line: 20, column: 3, scope: !89) +// CHECK:STDOUT: !98 = !DILocation(line: 21, column: 3, scope: !89) +// CHECK:STDOUT: !99 = !DILocation(line: 23, column: 3, scope: !89) +// CHECK:STDOUT: !103 = !DILocation(line: 24, column: 3, scope: !89) +// CHECK:STDOUT: !104 = !DILocation(line: 13, column: 23, scope: !89) +// CHECK:STDOUT: !105 = !DILocation(line: 25, column: 3, scope: !89) +// CHECK:STDOUT: !106 = !DILocation(line: 26, column: 23, scope: !89) +// CHECK:STDOUT: !107 = !DILocation(line: 26, column: 3, scope: !89) +// CHECK:STDOUT: !108 = !DILocation(line: 17, column: 1, scope: !89) +// CHECK:STDOUT: !109 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Default.dc3dd9c349162a91.Core:C.Cpp", scope: null, file: !87, line: 5, type: !27, spFlags: DISPFlagDefinition, unit: !88) +// CHECK:STDOUT: !111 = !DILocation(line: 5, column: 7, scope: !109) +// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "Op", linkageName: "_COp.51f3fb62cb986374:DefaultOrUnformed.Core.67b28f83c7cfd60c", scope: null, file: !4, line: 9, type: !27, spFlags: DISPFlagDefinition, unit: !88) +// CHECK:STDOUT: !115 = !DILocation(line: 9, column: 28, scope: !112) +// CHECK:STDOUT: !116 = !DILocation(line: 9, column: 21, scope: !112) +// CHECK:STDOUT: !117 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.4d2f117a5a2332f0", scope: null, file: !10, line: 32, type: !25, spFlags: DISPFlagDefinition, unit: !88, retainedNodes: !123) +// CHECK:STDOUT: !118 = !DILocalVariable(arg: 1, scope: !117, type: !23) +// CHECK:STDOUT: !122 = !DILocation(line: 32, column: 1, scope: !117) +// CHECK:STDOUT: !123 = !{!118} +// CHECK:STDOUT: !124 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.f127f30143696d51", scope: null, file: !10, line: 32, type: !29, spFlags: DISPFlagDefinition, unit: !88, retainedNodes: !130) +// CHECK:STDOUT: !125 = !DILocalVariable(arg: 1, scope: !124, type: !20) +// CHECK:STDOUT: !129 = !DILocation(line: 32, column: 1, scope: !124) +// CHECK:STDOUT: !130 = !{!125} +// CHECK:STDOUT: !131 = !{} +// CHECK:STDOUT: !133 = !{i64 4} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'return_references.carbon' @@ -568,15 +570,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 !135 { +// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !136 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnCRef.call = call ptr @_Z10ReturnCRefv(), !dbg !136 -// CHECK:STDOUT: %ReturnCRRef.call = call ptr @_Z11ReturnCRRefv(), !dbg !139 -// CHECK:STDOUT: %ReturnConstCRef.call = call ptr @_Z15ReturnConstCRefv(), !dbg !142 -// CHECK:STDOUT: %ReturnIntRef.call = call ptr @_Z12ReturnIntRefv(), !dbg !145 -// CHECK:STDOUT: %ReturnIntRRef.call = call ptr @_Z13ReturnIntRRefv(), !dbg !148 -// CHECK:STDOUT: %ReturnConstIntRef.call = call ptr @_Z17ReturnConstIntRefv(), !dbg !151 -// CHECK:STDOUT: ret void, !dbg !154 +// CHECK:STDOUT: %ReturnCRef.call = call ptr @_Z10ReturnCRefv(), !dbg !137 +// CHECK:STDOUT: %ReturnCRRef.call = call ptr @_Z11ReturnCRRefv(), !dbg !140 +// CHECK:STDOUT: %ReturnConstCRef.call = call ptr @_Z15ReturnConstCRefv(), !dbg !143 +// CHECK:STDOUT: %ReturnIntRef.call = call ptr @_Z12ReturnIntRefv(), !dbg !146 +// CHECK:STDOUT: %ReturnIntRRef.call = call ptr @_Z13ReturnIntRRefv(), !dbg !149 +// CHECK:STDOUT: %ReturnConstIntRef.call = call ptr @_Z17ReturnConstIntRefv(), !dbg !152 +// CHECK:STDOUT: ret void, !dbg !155 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare noundef nonnull align 1 dereferenceable(1) ptr @_Z10ReturnCRefv() #1 @@ -594,9 +596,9 @@ fn GetRefs() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!134} -// CHECK:STDOUT: !llvm.module.flags = !{!81, !82, !83, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!85} +// CHECK:STDOUT: !llvm.dbg.cu = !{!135} +// CHECK:STDOUT: !llvm.module.flags = !{!81, !82, !83, !84, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!86} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -605,21 +607,22 @@ fn GetRefs() { // CHECK:STDOUT: !72 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !73 = !{!"omnipotent char", !72, i64 0} // CHECK:STDOUT: !78 = !{!"int", !73, i64 0} -// CHECK:STDOUT: !81 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !82 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !83 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !84 = !{!"__libc_errno", !78, i64 0} -// CHECK:STDOUT: !85 = !{!84, !78, i64 0} -// CHECK:STDOUT: !133 = !DIFile(filename: "return_references.carbon", directory: "") -// CHECK:STDOUT: !134 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !133, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !135 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !133, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !134) -// CHECK:STDOUT: !136 = !DILocation(line: 17, column: 22, scope: !135) -// CHECK:STDOUT: !139 = !DILocation(line: 18, column: 22, scope: !135) -// CHECK:STDOUT: !142 = !DILocation(line: 19, column: 28, scope: !135) -// CHECK:STDOUT: !145 = !DILocation(line: 21, column: 20, scope: !135) -// CHECK:STDOUT: !148 = !DILocation(line: 22, column: 20, scope: !135) -// CHECK:STDOUT: !151 = !DILocation(line: 23, column: 26, scope: !135) -// CHECK:STDOUT: !154 = !DILocation(line: 16, column: 1, scope: !135) +// CHECK:STDOUT: !81 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !82 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !83 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !84 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !85 = !{!"__libc_errno", !78, i64 0} +// CHECK:STDOUT: !86 = !{!85, !78, i64 0} +// CHECK:STDOUT: !134 = !DIFile(filename: "return_references.carbon", directory: "") +// CHECK:STDOUT: !135 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !134, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !134, line: 16, type: !22, spFlags: DISPFlagDefinition, unit: !135) +// CHECK:STDOUT: !137 = !DILocation(line: 17, column: 22, scope: !136) +// CHECK:STDOUT: !140 = !DILocation(line: 18, column: 22, scope: !136) +// CHECK:STDOUT: !143 = !DILocation(line: 19, column: 28, scope: !136) +// CHECK:STDOUT: !146 = !DILocation(line: 21, column: 20, scope: !136) +// CHECK:STDOUT: !149 = !DILocation(line: 22, column: 20, scope: !136) +// CHECK:STDOUT: !152 = !DILocation(line: 23, column: 26, scope: !136) +// CHECK:STDOUT: !155 = !DILocation(line: 16, column: 1, scope: !136) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'return_references_via_thunk.carbon' @@ -630,15 +633,15 @@ fn GetRefs() { // CHECK:STDOUT: %class.ForceThunk.23 = type { i8 } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !157 { +// CHECK:STDOUT: define void @_CGetRefs.Main() #0 !dbg !158 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %ReturnCRef__carbon_thunk.call = call ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk.(), !dbg !158 -// CHECK:STDOUT: %ReturnCRRef__carbon_thunk.call = call ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk.(), !dbg !161 -// CHECK:STDOUT: %ReturnConstCRef__carbon_thunk.call = call ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk.(), !dbg !164 -// CHECK:STDOUT: %ReturnIntRef__carbon_thunk.call = call ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk.(), !dbg !167 -// CHECK:STDOUT: %ReturnIntRRef__carbon_thunk.call = call ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk.(), !dbg !170 -// CHECK:STDOUT: %ReturnConstIntRef__carbon_thunk.call = call ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk.(), !dbg !173 -// CHECK:STDOUT: ret void, !dbg !176 +// CHECK:STDOUT: %ReturnCRef__carbon_thunk.call = call ptr @_Z10ReturnCRef10ForceThunk.carbon_thunk.(), !dbg !159 +// CHECK:STDOUT: %ReturnCRRef__carbon_thunk.call = call ptr @_Z11ReturnCRRef10ForceThunk.carbon_thunk.(), !dbg !162 +// CHECK:STDOUT: %ReturnConstCRef__carbon_thunk.call = call ptr @_Z15ReturnConstCRef10ForceThunk.carbon_thunk.(), !dbg !165 +// CHECK:STDOUT: %ReturnIntRef__carbon_thunk.call = call ptr @_Z12ReturnIntRef10ForceThunk.carbon_thunk.(), !dbg !168 +// CHECK:STDOUT: %ReturnIntRRef__carbon_thunk.call = call ptr @_Z13ReturnIntRRef10ForceThunk.carbon_thunk.(), !dbg !171 +// CHECK:STDOUT: %ReturnConstIntRef__carbon_thunk.call = call ptr @_Z17ReturnConstIntRef10ForceThunk.carbon_thunk.(), !dbg !174 +// CHECK:STDOUT: ret void, !dbg !177 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -705,9 +708,9 @@ fn GetRefs() { // CHECK:STDOUT: attributes #1 = { alwaysinline 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" } // CHECK:STDOUT: attributes #2 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!156} -// CHECK:STDOUT: !llvm.module.flags = !{!81, !82, !83, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!85} +// CHECK:STDOUT: !llvm.dbg.cu = !{!157} +// CHECK:STDOUT: !llvm.module.flags = !{!81, !82, !83, !84, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!86} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -716,19 +719,20 @@ fn GetRefs() { // CHECK:STDOUT: !72 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !73 = !{!"omnipotent char", !72, i64 0} // CHECK:STDOUT: !78 = !{!"int", !73, i64 0} -// CHECK:STDOUT: !81 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !82 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !83 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !84 = !{!"__libc_errno", !78, i64 0} -// CHECK:STDOUT: !85 = !{!84, !78, i64 0} -// CHECK:STDOUT: !155 = !DIFile(filename: "return_references_via_thunk.carbon", directory: "") -// CHECK:STDOUT: !156 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !155, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !157 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !155, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !156) -// CHECK:STDOUT: !158 = !DILocation(line: 18, column: 22, scope: !157) -// CHECK:STDOUT: !161 = !DILocation(line: 19, column: 22, scope: !157) -// CHECK:STDOUT: !164 = !DILocation(line: 20, column: 28, scope: !157) -// CHECK:STDOUT: !167 = !DILocation(line: 22, column: 20, scope: !157) -// CHECK:STDOUT: !170 = !DILocation(line: 23, column: 20, scope: !157) -// CHECK:STDOUT: !173 = !DILocation(line: 24, column: 26, scope: !157) -// CHECK:STDOUT: !176 = !DILocation(line: 17, column: 1, scope: !157) +// CHECK:STDOUT: !81 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !82 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !83 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !84 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !85 = !{!"__libc_errno", !78, i64 0} +// CHECK:STDOUT: !86 = !{!85, !78, i64 0} +// CHECK:STDOUT: !156 = !DIFile(filename: "return_references_via_thunk.carbon", directory: "") +// CHECK:STDOUT: !157 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !156, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !158 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !156, line: 17, type: !22, spFlags: DISPFlagDefinition, unit: !157) +// CHECK:STDOUT: !159 = !DILocation(line: 18, column: 22, scope: !158) +// CHECK:STDOUT: !162 = !DILocation(line: 19, column: 22, scope: !158) +// CHECK:STDOUT: !165 = !DILocation(line: 20, column: 28, scope: !158) +// CHECK:STDOUT: !168 = !DILocation(line: 22, column: 20, scope: !158) +// CHECK:STDOUT: !171 = !DILocation(line: 23, column: 20, scope: !158) +// CHECK:STDOUT: !174 = !DILocation(line: 24, column: 26, scope: !158) +// CHECK:STDOUT: !177 = !DILocation(line: 17, column: 1, scope: !158) // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/share_ast.carbon b/toolchain/lower/testdata/interop/cpp/share_ast.carbon index 57c2707470a7..e677d97978c2 100644 --- a/toolchain/lower/testdata/interop/cpp/share_ast.carbon +++ b/toolchain/lower/testdata/interop/cpp/share_ast.carbon @@ -91,23 +91,23 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: $_Z6make_av = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CTest.Main() #0 !dbg !50 { +// CHECK:STDOUT: define i32 @_CTest.Main() #0 !dbg !51 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca [8 x i8], align 4, !dbg !53 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !53 -// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %a.var), !dbg !54 -// CHECK:STDOUT: %.loc6_11.1.b = getelementptr inbounds nuw [8 x i8], ptr %a.var, i32 0, i32 4, !dbg !56 -// CHECK:STDOUT: %.loc6_11.2 = load i32, ptr %.loc6_11.1.b, align 4, !dbg !56 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.e885b4b34ded440e(ptr %a.var), !dbg !53 -// CHECK:STDOUT: ret i32 %.loc6_11.2, !dbg !57 +// CHECK:STDOUT: %a.var = alloca [8 x i8], align 4, !dbg !54 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !54 +// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %a.var), !dbg !55 +// CHECK:STDOUT: %.loc6_11.1.b = getelementptr inbounds nuw [8 x i8], ptr %a.var, i32 0, i32 4, !dbg !57 +// CHECK:STDOUT: %.loc6_11.2 = load i32, ptr %.loc6_11.1.b, align 4, !dbg !57 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.e885b4b34ded440e(ptr %a.var), !dbg !54 +// CHECK:STDOUT: ret i32 %.loc6_11.2, !dbg !58 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z6make_av.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 !67 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !67 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !68 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !68 // CHECK:STDOUT: %call = call i64 @_Z6make_av() // CHECK:STDOUT: store i64 %call, ptr %0, align 4 // CHECK:STDOUT: ret void @@ -117,8 +117,8 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.e885b4b34ded440e(ptr %t) #0 !dbg !58 { -// CHECK:STDOUT: ret void, !dbg !63 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.e885b4b34ded440e(ptr %t) #0 !dbg !59 { +// CHECK:STDOUT: ret void, !dbg !64 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable @@ -126,9 +126,9 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %retval = alloca %struct.A, align 4 // CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A, ptr %retval, i32 0, i32 0 -// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !69 +// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !70 // CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A, ptr %retval, i32 0, i32 1 -// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !70 +// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !71 // CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 // CHECK:STDOUT: ret i64 %0 // CHECK:STDOUT: } @@ -138,44 +138,45 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { inlinehint 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!43} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!9} +// CHECK:STDOUT: !llvm.dbg.cu = !{!44} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !5, !11, !12} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!10} // CHECK:STDOUT: -// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !5 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0} -// CHECK:STDOUT: !7 = !{!"int", !6, i64 0} -// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0} -// CHECK:STDOUT: !9 = !{!8, !7, i64 0} -// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !34 = !DIFile(filename: "min_prelude/parts/destroy.carbon", directory: "") -// CHECK:STDOUT: !42 = !DIFile(filename: "use_a.carbon", directory: "") -// CHECK:STDOUT: !43 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !42, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !44 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !45 = !{!44} -// CHECK:STDOUT: !46 = !DISubroutineType(types: !45) -// CHECK:STDOUT: !47 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !48 = !{null, !47} -// CHECK:STDOUT: !49 = !DISubroutineType(types: !48) -// CHECK:STDOUT: !50 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !42, line: 4, type: !46, spFlags: DISPFlagDefinition, unit: !43) -// CHECK:STDOUT: !53 = !DILocation(line: 5, column: 3, scope: !50) -// CHECK:STDOUT: !54 = !DILocation(line: 5, column: 18, scope: !50) -// CHECK:STDOUT: !56 = !DILocation(line: 6, column: 10, scope: !50) -// CHECK:STDOUT: !57 = !DILocation(line: 6, column: 3, scope: !50) -// CHECK:STDOUT: !58 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.e885b4b34ded440e", scope: null, file: !34, line: 32, type: !49, spFlags: DISPFlagDefinition, unit: !43, retainedNodes: !64) -// CHECK:STDOUT: !59 = !DILocalVariable(arg: 1, scope: !58, type: !47) -// CHECK:STDOUT: !63 = !DILocation(line: 32, column: 1, scope: !58) -// CHECK:STDOUT: !64 = !{!59} -// CHECK:STDOUT: !65 = !{!"any pointer", !6, i64 0} -// CHECK:STDOUT: !66 = !{!"p1 _ZTS1A", !65, i64 0} -// CHECK:STDOUT: !67 = !{!66, !66, i64 0} -// CHECK:STDOUT: !68 = !{!"_ZTS1A", !7, i64 0, !7, i64 4} -// CHECK:STDOUT: !69 = !{!68, !7, i64 0} -// CHECK:STDOUT: !70 = !{!68, !7, i64 4} +// CHECK:STDOUT: !2 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !3 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !5 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !6 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !7 = !{!"omnipotent char", !6, i64 0} +// CHECK:STDOUT: !8 = !{!"int", !7, i64 0} +// CHECK:STDOUT: !9 = !{!"__libc_errno", !8, i64 0} +// CHECK:STDOUT: !10 = !{!9, !8, i64 0} +// CHECK:STDOUT: !11 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !12 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !35 = !DIFile(filename: "min_prelude/parts/destroy.carbon", directory: "") +// CHECK:STDOUT: !43 = !DIFile(filename: "use_a.carbon", directory: "") +// CHECK:STDOUT: !44 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !43, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !45 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !46 = !{!45} +// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) +// CHECK:STDOUT: !48 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !49 = !{null, !48} +// CHECK:STDOUT: !50 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !43, line: 4, type: !47, spFlags: DISPFlagDefinition, unit: !44) +// CHECK:STDOUT: !54 = !DILocation(line: 5, column: 3, scope: !51) +// CHECK:STDOUT: !55 = !DILocation(line: 5, column: 18, scope: !51) +// CHECK:STDOUT: !57 = !DILocation(line: 6, column: 10, scope: !51) +// CHECK:STDOUT: !58 = !DILocation(line: 6, column: 3, scope: !51) +// CHECK:STDOUT: !59 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.e885b4b34ded440e", scope: null, file: !35, line: 32, type: !50, spFlags: DISPFlagDefinition, unit: !44, retainedNodes: !65) +// CHECK:STDOUT: !60 = !DILocalVariable(arg: 1, scope: !59, type: !48) +// CHECK:STDOUT: !64 = !DILocation(line: 32, column: 1, scope: !59) +// CHECK:STDOUT: !65 = !{!60} +// CHECK:STDOUT: !66 = !{!"any pointer", !7, i64 0} +// CHECK:STDOUT: !67 = !{!"p1 _ZTS1A", !66, i64 0} +// CHECK:STDOUT: !68 = !{!67, !67, i64 0} +// CHECK:STDOUT: !69 = !{!"_ZTS1A", !8, i64 0, !8, i64 4} +// CHECK:STDOUT: !70 = !{!69, !8, i64 0} +// CHECK:STDOUT: !71 = !{!69, !8, i64 4} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'use_b.carbon' @@ -188,23 +189,23 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: $_Z6make_bv = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CTest.Main() #0 !dbg !73 { +// CHECK:STDOUT: define i32 @_CTest.Main() #0 !dbg !74 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !76 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !76 -// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !77 -// CHECK:STDOUT: %.loc6_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !79 -// CHECK:STDOUT: %.loc6_11.2 = load i32, ptr %.loc6_11.1.x, align 4, !dbg !79 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b993e18582fc56e0(ptr %b.var), !dbg !76 -// CHECK:STDOUT: ret i32 %.loc6_11.2, !dbg !80 +// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !77 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !77 +// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !78 +// CHECK:STDOUT: %.loc6_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !80 +// CHECK:STDOUT: %.loc6_11.2 = load i32, ptr %.loc6_11.1.x, align 4, !dbg !80 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b993e18582fc56e0(ptr %b.var), !dbg !77 +// CHECK:STDOUT: ret i32 %.loc6_11.2, !dbg !81 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z6make_bv.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 !89 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !89 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !90 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !90 // CHECK:STDOUT: %call = call i64 @_Z6make_bv() // CHECK:STDOUT: store i64 %call, ptr %0, align 4 // CHECK:STDOUT: ret void @@ -214,8 +215,8 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.b993e18582fc56e0(ptr %t) #0 !dbg !81 { -// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.b993e18582fc56e0(ptr %t) #0 !dbg !82 { +// CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable @@ -223,9 +224,9 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %retval = alloca %struct.B, align 4 // CHECK:STDOUT: %x = getelementptr inbounds nuw %struct.B, ptr %retval, i32 0, i32 0 -// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !91 +// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !92 // CHECK:STDOUT: %y = getelementptr inbounds nuw %struct.B, ptr %retval, i32 0, i32 1 -// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !92 +// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !93 // CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 // CHECK:STDOUT: ret i64 %0 // CHECK:STDOUT: } @@ -235,44 +236,45 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { inlinehint 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!72} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!9} +// CHECK:STDOUT: !llvm.dbg.cu = !{!73} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !5, !11, !12} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!10} // CHECK:STDOUT: -// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !5 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0} -// CHECK:STDOUT: !7 = !{!"int", !6, i64 0} -// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0} -// CHECK:STDOUT: !9 = !{!8, !7, i64 0} -// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !34 = !DIFile(filename: "min_prelude/parts/destroy.carbon", directory: "") -// CHECK:STDOUT: !44 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !45 = !{!44} -// CHECK:STDOUT: !46 = !DISubroutineType(types: !45) -// CHECK:STDOUT: !47 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !48 = !{null, !47} -// CHECK:STDOUT: !49 = !DISubroutineType(types: !48) -// CHECK:STDOUT: !65 = !{!"any pointer", !6, i64 0} -// CHECK:STDOUT: !71 = !DIFile(filename: "use_b.carbon", directory: "") -// CHECK:STDOUT: !72 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !71, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !73 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !71, line: 4, type: !46, spFlags: DISPFlagDefinition, unit: !72) -// CHECK:STDOUT: !76 = !DILocation(line: 5, column: 3, scope: !73) -// CHECK:STDOUT: !77 = !DILocation(line: 5, column: 18, scope: !73) -// CHECK:STDOUT: !79 = !DILocation(line: 6, column: 10, scope: !73) -// CHECK:STDOUT: !80 = !DILocation(line: 6, column: 3, scope: !73) -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.b993e18582fc56e0", scope: null, file: !34, line: 32, type: !49, spFlags: DISPFlagDefinition, unit: !72, retainedNodes: !87) -// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !47) -// CHECK:STDOUT: !86 = !DILocation(line: 32, column: 1, scope: !81) -// CHECK:STDOUT: !87 = !{!82} -// CHECK:STDOUT: !88 = !{!"p1 _ZTS1B", !65, i64 0} -// CHECK:STDOUT: !89 = !{!88, !88, i64 0} -// CHECK:STDOUT: !90 = !{!"_ZTS1B", !7, i64 0, !7, i64 4} -// CHECK:STDOUT: !91 = !{!90, !7, i64 0} -// CHECK:STDOUT: !92 = !{!90, !7, i64 4} +// CHECK:STDOUT: !2 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !3 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !5 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !6 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !7 = !{!"omnipotent char", !6, i64 0} +// CHECK:STDOUT: !8 = !{!"int", !7, i64 0} +// CHECK:STDOUT: !9 = !{!"__libc_errno", !8, i64 0} +// CHECK:STDOUT: !10 = !{!9, !8, i64 0} +// CHECK:STDOUT: !11 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !12 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !35 = !DIFile(filename: "min_prelude/parts/destroy.carbon", directory: "") +// CHECK:STDOUT: !45 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !46 = !{!45} +// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) +// CHECK:STDOUT: !48 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !49 = !{null, !48} +// CHECK:STDOUT: !50 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !66 = !{!"any pointer", !7, i64 0} +// CHECK:STDOUT: !72 = !DIFile(filename: "use_b.carbon", directory: "") +// CHECK:STDOUT: !73 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !72, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !74 = distinct !DISubprogram(name: "Test", linkageName: "_CTest.Main", scope: null, file: !72, line: 4, type: !47, spFlags: DISPFlagDefinition, unit: !73) +// CHECK:STDOUT: !77 = !DILocation(line: 5, column: 3, scope: !74) +// CHECK:STDOUT: !78 = !DILocation(line: 5, column: 18, scope: !74) +// CHECK:STDOUT: !80 = !DILocation(line: 6, column: 10, scope: !74) +// CHECK:STDOUT: !81 = !DILocation(line: 6, column: 3, scope: !74) +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.b993e18582fc56e0", scope: null, file: !35, line: 32, type: !50, spFlags: DISPFlagDefinition, unit: !73, retainedNodes: !88) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !48) +// CHECK:STDOUT: !87 = !DILocation(line: 32, column: 1, scope: !82) +// CHECK:STDOUT: !88 = !{!83} +// CHECK:STDOUT: !89 = !{!"p1 _ZTS1B", !66, i64 0} +// CHECK:STDOUT: !90 = !{!89, !89, i64 0} +// CHECK:STDOUT: !91 = !{!"_ZTS1B", !8, i64 0, !8, i64 4} +// CHECK:STDOUT: !92 = !{!91, !8, i64 0} +// CHECK:STDOUT: !93 = !{!91, !8, i64 4} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'use_both.carbon' @@ -288,46 +290,46 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: $_Z6make_bv = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CTestA.Main() #0 !dbg !95 { +// CHECK:STDOUT: define i32 @_CTestA.Main() #0 !dbg !96 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a.var = alloca [8 x i8], align 4, !dbg !98 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !98 -// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %a.var), !dbg !99 -// CHECK:STDOUT: %.loc7_11.1.b = getelementptr inbounds nuw [8 x i8], ptr %a.var, i32 0, i32 4, !dbg !101 -// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.b, align 4, !dbg !101 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.e885b4b34ded440e(ptr %a.var), !dbg !98 -// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !102 +// CHECK:STDOUT: %a.var = alloca [8 x i8], align 4, !dbg !99 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !99 +// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %a.var), !dbg !100 +// CHECK:STDOUT: %.loc7_11.1.b = getelementptr inbounds nuw [8 x i8], ptr %a.var, i32 0, i32 4, !dbg !102 +// CHECK:STDOUT: %.loc7_11.2 = load i32, ptr %.loc7_11.1.b, align 4, !dbg !102 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.e885b4b34ded440e(ptr %a.var), !dbg !99 +// CHECK:STDOUT: ret i32 %.loc7_11.2, !dbg !103 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z6make_av.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 !67 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !67 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !68 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !68 // CHECK:STDOUT: %call = call i64 @_Z6make_av() // CHECK:STDOUT: store i64 %call, ptr %0, align 4 // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CTestB.Main() #0 !dbg !103 { +// CHECK:STDOUT: define i32 @_CTestB.Main() #0 !dbg !104 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !106 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !106 -// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !107 -// CHECK:STDOUT: %.loc12_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !109 -// CHECK:STDOUT: %.loc12_11.2 = load i32, ptr %.loc12_11.1.x, align 4, !dbg !109 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.b993e18582fc56e0(ptr %b.var), !dbg !106 -// CHECK:STDOUT: ret i32 %.loc12_11.2, !dbg !110 +// CHECK:STDOUT: %b.var = alloca [8 x i8], align 4, !dbg !107 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b.var), !dbg !107 +// CHECK:STDOUT: call void @_Z6make_bv.carbon_thunk.(ptr %b.var), !dbg !108 +// CHECK:STDOUT: %.loc12_11.1.x = getelementptr inbounds nuw [8 x i8], ptr %b.var, i32 0, i32 0, !dbg !110 +// CHECK:STDOUT: %.loc12_11.2 = load i32, ptr %.loc12_11.1.x, align 4, !dbg !110 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.b993e18582fc56e0(ptr %b.var), !dbg !107 +// CHECK:STDOUT: ret i32 %.loc12_11.2, !dbg !111 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z6make_bv.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 !89 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !89 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !90 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !90 // CHECK:STDOUT: %call = call i64 @_Z6make_bv() // CHECK:STDOUT: store i64 %call, ptr %0, align 4 // CHECK:STDOUT: ret void @@ -337,13 +339,13 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.e885b4b34ded440e(ptr %t) #0 !dbg !111 { -// CHECK:STDOUT: ret void, !dbg !116 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.e885b4b34ded440e(ptr %t) #0 !dbg !112 { +// CHECK:STDOUT: ret void, !dbg !117 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.b993e18582fc56e0(ptr %t) #0 !dbg !118 { -// CHECK:STDOUT: ret void, !dbg !123 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.b993e18582fc56e0(ptr %t) #0 !dbg !119 { +// CHECK:STDOUT: ret void, !dbg !124 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable @@ -351,9 +353,9 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %retval = alloca %struct.A.34, align 4 // CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.34, ptr %retval, i32 0, i32 0 -// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !69 +// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !70 // CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.34, ptr %retval, i32 0, i32 1 -// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !70 +// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !71 // CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 // CHECK:STDOUT: ret i64 %0 // CHECK:STDOUT: } @@ -363,9 +365,9 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %retval = alloca %struct.B.35, align 4 // CHECK:STDOUT: %x = getelementptr inbounds nuw %struct.B.35, ptr %retval, i32 0, i32 0 -// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !91 +// CHECK:STDOUT: store i32 3, ptr %x, align 4, !tbaa !92 // CHECK:STDOUT: %y = getelementptr inbounds nuw %struct.B.35, ptr %retval, i32 0, i32 1 -// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !92 +// CHECK:STDOUT: store i32 4, ptr %y, align 4, !tbaa !93 // CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 // CHECK:STDOUT: ret i64 %0 // CHECK:STDOUT: } @@ -378,58 +380,59 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { inlinehint 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!94} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!9} +// CHECK:STDOUT: !llvm.dbg.cu = !{!95} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !5, !11, !12} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!10} // CHECK:STDOUT: -// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !5 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0} -// CHECK:STDOUT: !7 = !{!"int", !6, i64 0} -// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0} -// CHECK:STDOUT: !9 = !{!8, !7, i64 0} -// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !34 = !DIFile(filename: "min_prelude/parts/destroy.carbon", directory: "") -// CHECK:STDOUT: !44 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !45 = !{!44} -// CHECK:STDOUT: !46 = !DISubroutineType(types: !45) -// CHECK:STDOUT: !47 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !48 = !{null, !47} -// CHECK:STDOUT: !49 = !DISubroutineType(types: !48) -// CHECK:STDOUT: !65 = !{!"any pointer", !6, i64 0} -// CHECK:STDOUT: !66 = !{!"p1 _ZTS1A", !65, i64 0} -// CHECK:STDOUT: !67 = !{!66, !66, i64 0} -// CHECK:STDOUT: !68 = !{!"_ZTS1A", !7, i64 0, !7, i64 4} -// CHECK:STDOUT: !69 = !{!68, !7, i64 0} -// CHECK:STDOUT: !70 = !{!68, !7, i64 4} -// CHECK:STDOUT: !88 = !{!"p1 _ZTS1B", !65, i64 0} -// CHECK:STDOUT: !89 = !{!88, !88, i64 0} -// CHECK:STDOUT: !90 = !{!"_ZTS1B", !7, i64 0, !7, i64 4} -// CHECK:STDOUT: !91 = !{!90, !7, i64 0} -// CHECK:STDOUT: !92 = !{!90, !7, i64 4} -// CHECK:STDOUT: !93 = !DIFile(filename: "use_both.carbon", directory: "") -// CHECK:STDOUT: !94 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !93, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "TestA", linkageName: "_CTestA.Main", scope: null, file: !93, line: 5, type: !46, spFlags: DISPFlagDefinition, unit: !94) -// CHECK:STDOUT: !98 = !DILocation(line: 6, column: 3, scope: !95) -// CHECK:STDOUT: !99 = !DILocation(line: 6, column: 18, scope: !95) -// CHECK:STDOUT: !101 = !DILocation(line: 7, column: 10, scope: !95) -// CHECK:STDOUT: !102 = !DILocation(line: 7, column: 3, scope: !95) -// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "TestB", linkageName: "_CTestB.Main", scope: null, file: !93, line: 10, type: !46, spFlags: DISPFlagDefinition, unit: !94) -// CHECK:STDOUT: !106 = !DILocation(line: 11, column: 3, scope: !103) -// CHECK:STDOUT: !107 = !DILocation(line: 11, column: 18, scope: !103) -// CHECK:STDOUT: !109 = !DILocation(line: 12, column: 10, scope: !103) -// CHECK:STDOUT: !110 = !DILocation(line: 12, column: 3, scope: !103) -// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.e885b4b34ded440e", scope: null, file: !34, line: 32, type: !49, spFlags: DISPFlagDefinition, unit: !94, retainedNodes: !117) -// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !47) -// CHECK:STDOUT: !116 = !DILocation(line: 32, column: 1, scope: !111) -// CHECK:STDOUT: !117 = !{!112} -// CHECK:STDOUT: !118 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.b993e18582fc56e0", scope: null, file: !34, line: 32, type: !49, spFlags: DISPFlagDefinition, unit: !94, retainedNodes: !124) -// CHECK:STDOUT: !119 = !DILocalVariable(arg: 1, scope: !118, type: !47) -// CHECK:STDOUT: !123 = !DILocation(line: 32, column: 1, scope: !118) -// CHECK:STDOUT: !124 = !{!119} +// CHECK:STDOUT: !2 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !3 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !5 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !6 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !7 = !{!"omnipotent char", !6, i64 0} +// CHECK:STDOUT: !8 = !{!"int", !7, i64 0} +// CHECK:STDOUT: !9 = !{!"__libc_errno", !8, i64 0} +// CHECK:STDOUT: !10 = !{!9, !8, i64 0} +// CHECK:STDOUT: !11 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !12 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !35 = !DIFile(filename: "min_prelude/parts/destroy.carbon", directory: "") +// CHECK:STDOUT: !45 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !46 = !{!45} +// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) +// CHECK:STDOUT: !48 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !49 = !{null, !48} +// CHECK:STDOUT: !50 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !66 = !{!"any pointer", !7, i64 0} +// CHECK:STDOUT: !67 = !{!"p1 _ZTS1A", !66, i64 0} +// CHECK:STDOUT: !68 = !{!67, !67, i64 0} +// CHECK:STDOUT: !69 = !{!"_ZTS1A", !8, i64 0, !8, i64 4} +// CHECK:STDOUT: !70 = !{!69, !8, i64 0} +// CHECK:STDOUT: !71 = !{!69, !8, i64 4} +// CHECK:STDOUT: !89 = !{!"p1 _ZTS1B", !66, i64 0} +// CHECK:STDOUT: !90 = !{!89, !89, i64 0} +// CHECK:STDOUT: !91 = !{!"_ZTS1B", !8, i64 0, !8, i64 4} +// CHECK:STDOUT: !92 = !{!91, !8, i64 0} +// CHECK:STDOUT: !93 = !{!91, !8, i64 4} +// CHECK:STDOUT: !94 = !DIFile(filename: "use_both.carbon", directory: "") +// CHECK:STDOUT: !95 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !94, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "TestA", linkageName: "_CTestA.Main", scope: null, file: !94, line: 5, type: !47, spFlags: DISPFlagDefinition, unit: !95) +// CHECK:STDOUT: !99 = !DILocation(line: 6, column: 3, scope: !96) +// CHECK:STDOUT: !100 = !DILocation(line: 6, column: 18, scope: !96) +// CHECK:STDOUT: !102 = !DILocation(line: 7, column: 10, scope: !96) +// CHECK:STDOUT: !103 = !DILocation(line: 7, column: 3, scope: !96) +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "TestB", linkageName: "_CTestB.Main", scope: null, file: !94, line: 10, type: !47, spFlags: DISPFlagDefinition, unit: !95) +// CHECK:STDOUT: !107 = !DILocation(line: 11, column: 3, scope: !104) +// CHECK:STDOUT: !108 = !DILocation(line: 11, column: 18, scope: !104) +// CHECK:STDOUT: !110 = !DILocation(line: 12, column: 10, scope: !104) +// CHECK:STDOUT: !111 = !DILocation(line: 12, column: 3, scope: !104) +// CHECK:STDOUT: !112 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.e885b4b34ded440e", scope: null, file: !35, line: 32, type: !50, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !118) +// CHECK:STDOUT: !113 = !DILocalVariable(arg: 1, scope: !112, type: !48) +// CHECK:STDOUT: !117 = !DILocation(line: 32, column: 1, scope: !112) +// CHECK:STDOUT: !118 = !{!113} +// CHECK:STDOUT: !119 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.b993e18582fc56e0", scope: null, file: !35, line: 32, type: !50, spFlags: DISPFlagDefinition, unit: !95, retainedNodes: !125) +// CHECK:STDOUT: !120 = !DILocalVariable(arg: 1, scope: !119, type: !48) +// CHECK:STDOUT: !124 = !DILocation(line: 32, column: 1, scope: !119) +// CHECK:STDOUT: !125 = !{!120} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'generic_lib.carbon' @@ -445,8 +448,8 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: define internal void @_Z6make_av.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 !67 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !67 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !68 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !68 // CHECK:STDOUT: %call = call i64 @_Z6make_av() // CHECK:STDOUT: store i64 %call, ptr %0, align 4 // CHECK:STDOUT: ret void @@ -457,9 +460,9 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %retval = alloca %struct.A.38, align 4 // CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.38, ptr %retval, i32 0, i32 0 -// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !69 +// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !70 // CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.38, ptr %retval, i32 0, i32 1 -// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !70 +// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !71 // CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 // CHECK:STDOUT: ret i64 %0 // CHECK:STDOUT: } @@ -467,28 +470,29 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: attributes #0 = { alwaysinline 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" } // CHECK:STDOUT: attributes #1 = { inlinehint 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!126} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!9} +// CHECK:STDOUT: !llvm.dbg.cu = !{!127} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !5, !11, !12} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!10} // CHECK:STDOUT: -// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !5 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0} -// CHECK:STDOUT: !7 = !{!"int", !6, i64 0} -// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0} -// CHECK:STDOUT: !9 = !{!8, !7, i64 0} -// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !65 = !{!"any pointer", !6, i64 0} -// CHECK:STDOUT: !66 = !{!"p1 _ZTS1A", !65, i64 0} -// CHECK:STDOUT: !67 = !{!66, !66, i64 0} -// CHECK:STDOUT: !68 = !{!"_ZTS1A", !7, i64 0, !7, i64 4} -// CHECK:STDOUT: !69 = !{!68, !7, i64 0} -// CHECK:STDOUT: !70 = !{!68, !7, i64 4} -// CHECK:STDOUT: !125 = !DIFile(filename: "generic_lib.carbon", directory: "") -// CHECK:STDOUT: !126 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !125, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !2 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !3 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !5 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !6 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !7 = !{!"omnipotent char", !6, i64 0} +// CHECK:STDOUT: !8 = !{!"int", !7, i64 0} +// CHECK:STDOUT: !9 = !{!"__libc_errno", !8, i64 0} +// CHECK:STDOUT: !10 = !{!9, !8, i64 0} +// CHECK:STDOUT: !11 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !12 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !66 = !{!"any pointer", !7, i64 0} +// CHECK:STDOUT: !67 = !{!"p1 _ZTS1A", !66, i64 0} +// CHECK:STDOUT: !68 = !{!67, !67, i64 0} +// CHECK:STDOUT: !69 = !{!"_ZTS1A", !8, i64 0, !8, i64 4} +// CHECK:STDOUT: !70 = !{!69, !8, i64 0} +// CHECK:STDOUT: !71 = !{!69, !8, i64 4} +// CHECK:STDOUT: !126 = !DIFile(filename: "generic_lib.carbon", directory: "") +// CHECK:STDOUT: !127 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !126, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'no_cpp_imports.carbon' @@ -501,29 +505,29 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: $_Z6make_av = comdat any // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define i32 @_CCallGeneric.Main() #0 !dbg !129 { +// CHECK:STDOUT: define i32 @_CCallGeneric.Main() #0 !dbg !130 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %MakeA.call = call i32 @_CMakeA.Main.084a2801e0f5d754({} zeroinitializer), !dbg !132 -// CHECK:STDOUT: ret i32 %MakeA.call, !dbg !135 +// CHECK:STDOUT: %MakeA.call = call i32 @_CMakeA.Main.084a2801e0f5d754({} zeroinitializer), !dbg !133 +// CHECK:STDOUT: ret i32 %MakeA.call, !dbg !136 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr i32 @_CMakeA.Main.084a2801e0f5d754({} %x) #0 !dbg !136 { -// CHECK:STDOUT: %1 = alloca [8 x i8], align 4, !dbg !141 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !141 -// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %1), !dbg !142 -// CHECK:STDOUT: %b = getelementptr inbounds nuw [8 x i8], ptr %1, i32 0, i32 4, !dbg !144 -// CHECK:STDOUT: %2 = load i32, ptr %b, align 4, !dbg !144 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.e885b4b34ded440e(ptr %1), !dbg !141 -// CHECK:STDOUT: ret i32 %2, !dbg !145 +// CHECK:STDOUT: define linkonce_odr i32 @_CMakeA.Main.084a2801e0f5d754({} %x) #0 !dbg !137 { +// CHECK:STDOUT: %1 = alloca [8 x i8], align 4, !dbg !142 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !142 +// CHECK:STDOUT: call void @_Z6make_av.carbon_thunk.(ptr %1), !dbg !143 +// CHECK:STDOUT: %b = getelementptr inbounds nuw [8 x i8], ptr %1, i32 0, i32 4, !dbg !145 +// CHECK:STDOUT: %2 = load i32, ptr %b, align 4, !dbg !145 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.e885b4b34ded440e(ptr %1), !dbg !142 +// CHECK:STDOUT: ret i32 %2, !dbg !146 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable // CHECK:STDOUT: define internal void @_Z6make_av.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 !67 -// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !67 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !68 +// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !68 // CHECK:STDOUT: %call = call i64 @_Z6make_av() // CHECK:STDOUT: store i64 %call, ptr %0, align 4 // CHECK:STDOUT: ret void @@ -533,8 +537,8 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.e885b4b34ded440e(ptr %t) #0 !dbg !147 { -// CHECK:STDOUT: ret void, !dbg !152 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.e885b4b34ded440e(ptr %t) #0 !dbg !148 { +// CHECK:STDOUT: ret void, !dbg !153 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable @@ -542,9 +546,9 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %retval = alloca %struct.A.41, align 4 // CHECK:STDOUT: %a = getelementptr inbounds nuw %struct.A.41, ptr %retval, i32 0, i32 0 -// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !69 +// CHECK:STDOUT: store i32 1, ptr %a, align 4, !tbaa !70 // CHECK:STDOUT: %b = getelementptr inbounds nuw %struct.A.41, ptr %retval, i32 0, i32 1 -// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !70 +// CHECK:STDOUT: store i32 2, ptr %b, align 4, !tbaa !71 // CHECK:STDOUT: %0 = load i64, ptr %retval, align 4 // CHECK:STDOUT: ret i64 %0 // CHECK:STDOUT: } @@ -554,50 +558,51 @@ fn CallGeneric() -> i32 { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { inlinehint 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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!128} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !10, !11} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!9} +// CHECK:STDOUT: !llvm.dbg.cu = !{!129} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3, !4, !5, !11, !12} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!10} // CHECK:STDOUT: -// CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !5 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !6 = !{!"omnipotent char", !5, i64 0} -// CHECK:STDOUT: !7 = !{!"int", !6, i64 0} -// CHECK:STDOUT: !8 = !{!"__libc_errno", !7, i64 0} -// CHECK:STDOUT: !9 = !{!8, !7, i64 0} -// CHECK:STDOUT: !10 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !11 = !{i32 2, !"Debug Info Version", i32 3} -// CHECK:STDOUT: !34 = !DIFile(filename: "min_prelude/parts/destroy.carbon", directory: "") -// CHECK:STDOUT: !44 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) -// CHECK:STDOUT: !45 = !{!44} -// CHECK:STDOUT: !46 = !DISubroutineType(types: !45) -// CHECK:STDOUT: !47 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) -// CHECK:STDOUT: !48 = !{null, !47} -// CHECK:STDOUT: !49 = !DISubroutineType(types: !48) -// CHECK:STDOUT: !65 = !{!"any pointer", !6, i64 0} -// CHECK:STDOUT: !66 = !{!"p1 _ZTS1A", !65, i64 0} -// CHECK:STDOUT: !67 = !{!66, !66, i64 0} -// CHECK:STDOUT: !68 = !{!"_ZTS1A", !7, i64 0, !7, i64 4} -// CHECK:STDOUT: !69 = !{!68, !7, i64 0} -// CHECK:STDOUT: !70 = !{!68, !7, i64 4} -// CHECK:STDOUT: !125 = !DIFile(filename: "generic_lib.carbon", directory: "") -// CHECK:STDOUT: !127 = !DIFile(filename: "no_cpp_imports.carbon", directory: "") -// CHECK:STDOUT: !128 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !127, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !129 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.Main", scope: null, file: !127, line: 4, type: !46, spFlags: DISPFlagDefinition, unit: !128) -// CHECK:STDOUT: !132 = !DILocation(line: 5, column: 10, scope: !129) -// CHECK:STDOUT: !133 = !{!44, !47} -// CHECK:STDOUT: !134 = !DISubroutineType(types: !133) -// CHECK:STDOUT: !135 = !DILocation(line: 5, column: 3, scope: !129) -// CHECK:STDOUT: !136 = distinct !DISubprogram(name: "MakeA", linkageName: "_CMakeA.Main.084a2801e0f5d754", scope: null, file: !125, line: 4, type: !134, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !146) -// CHECK:STDOUT: !137 = !DILocalVariable(arg: 1, scope: !136, type: !47) -// CHECK:STDOUT: !141 = !DILocation(line: 5, column: 3, scope: !136) -// CHECK:STDOUT: !142 = !DILocation(line: 5, column: 18, scope: !136) -// CHECK:STDOUT: !144 = !DILocation(line: 6, column: 10, scope: !136) -// CHECK:STDOUT: !145 = !DILocation(line: 6, column: 3, scope: !136) -// CHECK:STDOUT: !146 = !{!137} -// CHECK:STDOUT: !147 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.e885b4b34ded440e", scope: null, file: !34, line: 32, type: !49, spFlags: DISPFlagDefinition, unit: !128, retainedNodes: !153) -// CHECK:STDOUT: !148 = !DILocalVariable(arg: 1, scope: !147, type: !47) -// CHECK:STDOUT: !152 = !DILocation(line: 32, column: 1, scope: !147) -// CHECK:STDOUT: !153 = !{!148} +// CHECK:STDOUT: !2 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !3 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !5 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !6 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !7 = !{!"omnipotent char", !6, i64 0} +// CHECK:STDOUT: !8 = !{!"int", !7, i64 0} +// CHECK:STDOUT: !9 = !{!"__libc_errno", !8, i64 0} +// CHECK:STDOUT: !10 = !{!9, !8, i64 0} +// CHECK:STDOUT: !11 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !12 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !35 = !DIFile(filename: "min_prelude/parts/destroy.carbon", directory: "") +// CHECK:STDOUT: !45 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +// CHECK:STDOUT: !46 = !{!45} +// CHECK:STDOUT: !47 = !DISubroutineType(types: !46) +// CHECK:STDOUT: !48 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) +// CHECK:STDOUT: !49 = !{null, !48} +// CHECK:STDOUT: !50 = !DISubroutineType(types: !49) +// CHECK:STDOUT: !66 = !{!"any pointer", !7, i64 0} +// CHECK:STDOUT: !67 = !{!"p1 _ZTS1A", !66, i64 0} +// CHECK:STDOUT: !68 = !{!67, !67, i64 0} +// CHECK:STDOUT: !69 = !{!"_ZTS1A", !8, i64 0, !8, i64 4} +// CHECK:STDOUT: !70 = !{!69, !8, i64 0} +// CHECK:STDOUT: !71 = !{!69, !8, i64 4} +// CHECK:STDOUT: !126 = !DIFile(filename: "generic_lib.carbon", directory: "") +// CHECK:STDOUT: !128 = !DIFile(filename: "no_cpp_imports.carbon", directory: "") +// CHECK:STDOUT: !129 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !128, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !130 = distinct !DISubprogram(name: "CallGeneric", linkageName: "_CCallGeneric.Main", scope: null, file: !128, line: 4, type: !47, spFlags: DISPFlagDefinition, unit: !129) +// CHECK:STDOUT: !133 = !DILocation(line: 5, column: 10, scope: !130) +// CHECK:STDOUT: !134 = !{!45, !48} +// CHECK:STDOUT: !135 = !DISubroutineType(types: !134) +// CHECK:STDOUT: !136 = !DILocation(line: 5, column: 3, scope: !130) +// CHECK:STDOUT: !137 = distinct !DISubprogram(name: "MakeA", linkageName: "_CMakeA.Main.084a2801e0f5d754", scope: null, file: !126, line: 4, type: !135, spFlags: DISPFlagDefinition, unit: !129, retainedNodes: !147) +// CHECK:STDOUT: !138 = !DILocalVariable(arg: 1, scope: !137, type: !48) +// CHECK:STDOUT: !142 = !DILocation(line: 5, column: 3, scope: !137) +// CHECK:STDOUT: !143 = !DILocation(line: 5, column: 18, scope: !137) +// CHECK:STDOUT: !145 = !DILocation(line: 6, column: 10, scope: !137) +// CHECK:STDOUT: !146 = !DILocation(line: 6, column: 3, scope: !137) +// CHECK:STDOUT: !147 = !{!138} +// CHECK:STDOUT: !148 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.e885b4b34ded440e", scope: null, file: !35, line: 32, type: !50, spFlags: DISPFlagDefinition, unit: !129, retainedNodes: !154) +// CHECK:STDOUT: !149 = !DILocalVariable(arg: 1, scope: !148, type: !48) +// CHECK:STDOUT: !153 = !DILocation(line: 32, column: 1, scope: !148) +// CHECK:STDOUT: !154 = !{!149} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_pointer.carbon b/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_pointer.carbon index e9c42f1526fa..9ac0ec941cd7 100644 --- a/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_pointer.carbon +++ b/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_pointer.carbon @@ -306,8 +306,8 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!106, !107, !108, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!110} +// CHECK:STDOUT: !llvm.module.flags = !{!106, !107, !108, !109, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!111} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -390,9 +390,10 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: !103 = !{i64 0, i64 8, !102, i64 8, i64 8, !102} // CHECK:STDOUT: !104 = !{!"p1 _ZTS15nontrivial_dtor", !94, i64 0} // CHECK:STDOUT: !105 = !{!104, !104, i64 0} -// CHECK:STDOUT: !106 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !107 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !108 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !109 = !{!"__libc_errno", !99, i64 0} -// CHECK:STDOUT: !110 = !{!109, !99, i64 0} +// CHECK:STDOUT: !106 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !107 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !108 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !109 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !110 = !{!"__libc_errno", !99, i64 0} +// CHECK:STDOUT: !111 = !{!110, !99, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_size.carbon b/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_size.carbon index a42401ce5f4c..216e383020e2 100644 --- a/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_size.carbon +++ b/toolchain/lower/testdata/interop/cpp/std_initializer_list_pointer_size.carbon @@ -305,8 +305,8 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!109, !110, !111, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!113} +// CHECK:STDOUT: !llvm.module.flags = !{!109, !110, !111, !112, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!114} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -391,9 +391,10 @@ fn InitNontrivialDtor() { // CHECK:STDOUT: !106 = !{i64 0, i64 8, !104, i64 8, i64 8, !105} // CHECK:STDOUT: !107 = !{!"p1 _ZTS15nontrivial_dtor", !95, i64 0} // CHECK:STDOUT: !108 = !{!107, !107, i64 0} -// CHECK:STDOUT: !109 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !110 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !111 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !112 = !{!"__libc_errno", !100, i64 0} -// CHECK:STDOUT: !113 = !{!112, !100, i64 0} +// CHECK:STDOUT: !109 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !110 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !111 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !112 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !113 = !{!"__libc_errno", !100, i64 0} +// CHECK:STDOUT: !114 = !{!113, !100, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/template.carbon b/toolchain/lower/testdata/interop/cpp/template.carbon index 3736abe779f9..3089f808288d 100644 --- a/toolchain/lower/testdata/interop/cpp/template.carbon +++ b/toolchain/lower/testdata/interop/cpp/template.carbon @@ -158,8 +158,8 @@ fn Call3() { // CHECK:STDOUT: attributes #2 = { alwaysinline 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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!19} -// CHECK:STDOUT: !llvm.module.flags = !{!63, !64, !65, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!67} +// CHECK:STDOUT: !llvm.module.flags = !{!63, !64, !65, !66, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!68} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -193,11 +193,12 @@ fn Call3() { // CHECK:STDOUT: !59 = !{!"any pointer", !56, i64 0} // CHECK:STDOUT: !60 = !{!"p1 _ZTS5Class", !59, i64 0} // CHECK:STDOUT: !61 = !{!60, !60, i64 0} -// CHECK:STDOUT: !63 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !64 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !65 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !66 = !{!"__libc_errno", !57, i64 0} -// CHECK:STDOUT: !67 = !{!66, !57, i64 0} +// CHECK:STDOUT: !63 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !64 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !65 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !66 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !67 = !{!"__libc_errno", !57, i64 0} +// CHECK:STDOUT: !68 = !{!67, !57, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'variadic.carbon' @@ -206,28 +207,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 !78 { +// CHECK:STDOUT: define void @_CCall1.Main() #0 !dbg !79 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z3fooIJEEviDpT_(i32 1), !dbg !79 -// CHECK:STDOUT: ret void, !dbg !80 +// CHECK:STDOUT: call void @_Z3fooIJEEviDpT_(i32 1), !dbg !80 +// CHECK:STDOUT: ret void, !dbg !81 // 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 !81 { +// CHECK:STDOUT: define void @_CCall2.Main() #0 !dbg !82 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z3fooIJiEEviDpT_(i32 1, i32 2), !dbg !82 -// CHECK:STDOUT: ret void, !dbg !83 +// CHECK:STDOUT: call void @_Z3fooIJiEEviDpT_(i32 1, i32 2), !dbg !83 +// CHECK:STDOUT: ret void, !dbg !84 // 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 !84 { +// CHECK:STDOUT: define void @_CCall3.Main() #0 !dbg !85 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_Z3fooIJiiEEviDpT_(i32 1, i32 2, i32 3), !dbg !85 -// CHECK:STDOUT: ret void, !dbg !86 +// CHECK:STDOUT: call void @_Z3fooIJiiEEviDpT_(i32 1, i32 2, i32 3), !dbg !86 +// CHECK:STDOUT: ret void, !dbg !87 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z3fooIJiiEEviDpT_(i32 noundef, i32 noundef, i32 noundef) #1 @@ -235,33 +236,34 @@ fn Call3() { // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!69} -// CHECK:STDOUT: !llvm.module.flags = !{!63, !64, !65, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!67} +// CHECK:STDOUT: !llvm.dbg.cu = !{!70} +// CHECK:STDOUT: !llvm.module.flags = !{!63, !64, !65, !66, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!68} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !55 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !56 = !{!"omnipotent char", !55, i64 0} // CHECK:STDOUT: !57 = !{!"int", !56, i64 0} -// CHECK:STDOUT: !63 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !64 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !65 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !66 = !{!"__libc_errno", !57, i64 0} -// CHECK:STDOUT: !67 = !{!66, !57, i64 0} -// CHECK:STDOUT: !68 = !DIFile(filename: "variadic.carbon", directory: "") -// CHECK:STDOUT: !69 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !68, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !70 = !{null} -// CHECK:STDOUT: !71 = !DISubroutineType(types: !70) -// CHECK:STDOUT: !78 = distinct !DISubprogram(name: "Call1", linkageName: "_CCall1.Main", scope: null, file: !68, line: 9, type: !71, spFlags: DISPFlagDefinition, unit: !69) -// CHECK:STDOUT: !79 = !DILocation(line: 11, column: 3, scope: !78) -// CHECK:STDOUT: !80 = !DILocation(line: 9, column: 1, scope: !78) -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !68, line: 15, type: !71, spFlags: DISPFlagDefinition, unit: !69) -// CHECK:STDOUT: !82 = !DILocation(line: 17, column: 3, scope: !81) -// CHECK:STDOUT: !83 = !DILocation(line: 15, column: 1, scope: !81) -// CHECK:STDOUT: !84 = distinct !DISubprogram(name: "Call3", linkageName: "_CCall3.Main", scope: null, file: !68, line: 21, type: !71, spFlags: DISPFlagDefinition, unit: !69) -// CHECK:STDOUT: !85 = !DILocation(line: 23, column: 3, scope: !84) -// CHECK:STDOUT: !86 = !DILocation(line: 21, column: 1, scope: !84) +// CHECK:STDOUT: !63 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !64 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !65 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !66 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !67 = !{!"__libc_errno", !57, i64 0} +// CHECK:STDOUT: !68 = !{!67, !57, i64 0} +// CHECK:STDOUT: !69 = !DIFile(filename: "variadic.carbon", directory: "") +// CHECK:STDOUT: !70 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !69, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !71 = !{null} +// CHECK:STDOUT: !72 = !DISubroutineType(types: !71) +// CHECK:STDOUT: !79 = distinct !DISubprogram(name: "Call1", linkageName: "_CCall1.Main", scope: null, file: !69, line: 9, type: !72, spFlags: DISPFlagDefinition, unit: !70) +// CHECK:STDOUT: !80 = !DILocation(line: 11, column: 3, scope: !79) +// CHECK:STDOUT: !81 = !DILocation(line: 9, column: 1, scope: !79) +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !69, line: 15, type: !72, spFlags: DISPFlagDefinition, unit: !70) +// CHECK:STDOUT: !83 = !DILocation(line: 17, column: 3, scope: !82) +// CHECK:STDOUT: !84 = !DILocation(line: 15, column: 1, scope: !82) +// CHECK:STDOUT: !85 = distinct !DISubprogram(name: "Call3", linkageName: "_CCall3.Main", scope: null, file: !69, line: 21, type: !72, spFlags: DISPFlagDefinition, unit: !70) +// CHECK:STDOUT: !86 = !DILocation(line: 23, column: 3, scope: !85) +// CHECK:STDOUT: !87 = !DILocation(line: 21, column: 1, scope: !85) // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'variadic_thunk.carbon' @@ -275,13 +277,13 @@ 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 !95 { +// CHECK:STDOUT: define void @_CCall1.Main() #0 !dbg !96 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc12_12.2.temp = alloca {}, align 1, !dbg !96 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_12.2.temp), !dbg !96 -// CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_.carbon_thunk._(ptr @X.val.loc12_14.3), !dbg !97 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr @X.val), !dbg !96 -// CHECK:STDOUT: ret void, !dbg !98 +// CHECK:STDOUT: %.loc12_12.2.temp = alloca {}, align 1, !dbg !97 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_12.2.temp), !dbg !97 +// CHECK:STDOUT: call void @_Z3fooIJEEv1XDpT_.carbon_thunk._(ptr @X.val.loc12_14.3), !dbg !98 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr @X.val), !dbg !97 +// CHECK:STDOUT: ret void, !dbg !99 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -289,20 +291,20 @@ 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 !115 -// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !115 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !116 +// CHECK:STDOUT: %1 = load ptr, ptr %.addr, align 8, !tbaa !116 // 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 !99 { +// CHECK:STDOUT: define void @_CCall2.Main() #0 !dbg !100 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc18_12.2.temp = alloca {}, align 1, !dbg !100 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_12.2.temp), !dbg !100 -// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk.__(ptr @X.val.loc12_14.3, i32 2), !dbg !101 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr @X.val), !dbg !100 -// CHECK:STDOUT: ret void, !dbg !102 +// CHECK:STDOUT: %.loc18_12.2.temp = alloca {}, align 1, !dbg !101 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc18_12.2.temp), !dbg !101 +// CHECK:STDOUT: call void @_Z3fooIJiEEv1XDpT_.carbon_thunk.__(ptr @X.val.loc12_14.3, i32 2), !dbg !102 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr @X.val), !dbg !101 +// CHECK:STDOUT: ret void, !dbg !103 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -311,22 +313,22 @@ 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 !115 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !116 // CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !58 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !115 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !116 // CHECK:STDOUT: %3 = load i32, ptr %.addr1, align 4, !tbaa !58 // 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 !103 { +// CHECK:STDOUT: define void @_CCall3.Main() #0 !dbg !104 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc24_12.2.temp = alloca {}, align 1, !dbg !104 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_12.2.temp), !dbg !104 -// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk.___(ptr @X.val.loc12_14.3, i32 2, i32 3), !dbg !105 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr @X.val), !dbg !104 -// CHECK:STDOUT: ret void, !dbg !106 +// CHECK:STDOUT: %.loc24_12.2.temp = alloca {}, align 1, !dbg !105 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_12.2.temp), !dbg !105 +// CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_.carbon_thunk.___(ptr @X.val.loc12_14.3, i32 2, i32 3), !dbg !106 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr @X.val), !dbg !105 +// CHECK:STDOUT: ret void, !dbg !107 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -336,10 +338,10 @@ 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 !115 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !116 // CHECK:STDOUT: store i32 %1, ptr %.addr1, align 4, !tbaa !58 // CHECK:STDOUT: store i32 %2, ptr %.addr2, align 4, !tbaa !58 -// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !115 +// CHECK:STDOUT: %3 = load ptr, ptr %.addr, align 8, !tbaa !116 // CHECK:STDOUT: %4 = load i32, ptr %.addr1, align 4, !tbaa !58 // CHECK:STDOUT: %5 = load i32, ptr %.addr2, align 4, !tbaa !58 // CHECK:STDOUT: call void @_Z3fooIJiiEEv1XDpT_(i32 noundef %4, i32 noundef %5) @@ -350,8 +352,8 @@ fn Call3() { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #2 // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr %t) #0 !dbg !107 { -// CHECK:STDOUT: ret void, !dbg !112 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.2d682b12c0c20e08(ptr %t) #0 !dbg !108 { +// CHECK:STDOUT: ret void, !dbg !113 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z3fooIJEEv1XDpT_() #3 @@ -369,9 +371,9 @@ fn Call3() { // CHECK:STDOUT: attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #3 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!88} -// CHECK:STDOUT: !llvm.module.flags = !{!63, !64, !65, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!67} +// CHECK:STDOUT: !llvm.dbg.cu = !{!89} +// CHECK:STDOUT: !llvm.module.flags = !{!63, !64, !65, !66, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!68} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -382,33 +384,34 @@ fn Call3() { // CHECK:STDOUT: !57 = !{!"int", !56, i64 0} // CHECK:STDOUT: !58 = !{!57, !57, i64 0} // CHECK:STDOUT: !59 = !{!"any pointer", !56, i64 0} -// CHECK:STDOUT: !63 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !64 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !65 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !66 = !{!"__libc_errno", !57, i64 0} -// CHECK:STDOUT: !67 = !{!66, !57, i64 0} -// CHECK:STDOUT: !70 = !{null} -// CHECK:STDOUT: !71 = !DISubroutineType(types: !70) -// CHECK:STDOUT: !87 = !DIFile(filename: "variadic_thunk.carbon", directory: "") -// CHECK:STDOUT: !88 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !87, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !89 = !{null, !23} -// CHECK:STDOUT: !90 = !DISubroutineType(types: !89) -// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Call1", linkageName: "_CCall1.Main", scope: null, file: !87, line: 10, type: !71, spFlags: DISPFlagDefinition, unit: !88) -// CHECK:STDOUT: !96 = !DILocation(line: 12, column: 11, scope: !95) -// CHECK:STDOUT: !97 = !DILocation(line: 12, column: 3, scope: !95) -// CHECK:STDOUT: !98 = !DILocation(line: 10, column: 1, scope: !95) -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !87, line: 16, type: !71, spFlags: DISPFlagDefinition, unit: !88) -// CHECK:STDOUT: !100 = !DILocation(line: 18, column: 11, scope: !99) -// CHECK:STDOUT: !101 = !DILocation(line: 18, column: 3, scope: !99) -// CHECK:STDOUT: !102 = !DILocation(line: 16, column: 1, scope: !99) -// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "Call3", linkageName: "_CCall3.Main", scope: null, file: !87, line: 22, type: !71, spFlags: DISPFlagDefinition, unit: !88) -// CHECK:STDOUT: !104 = !DILocation(line: 24, column: 11, scope: !103) -// CHECK:STDOUT: !105 = !DILocation(line: 24, column: 3, scope: !103) -// CHECK:STDOUT: !106 = !DILocation(line: 22, column: 1, scope: !103) -// CHECK:STDOUT: !107 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.2d682b12c0c20e08", scope: null, file: !10, line: 32, type: !90, spFlags: DISPFlagDefinition, unit: !88, retainedNodes: !113) -// CHECK:STDOUT: !108 = !DILocalVariable(arg: 1, scope: !107, type: !23) -// CHECK:STDOUT: !112 = !DILocation(line: 32, column: 1, scope: !107) -// CHECK:STDOUT: !113 = !{!108} -// CHECK:STDOUT: !114 = !{!"p1 _ZTS1X", !59, i64 0} -// CHECK:STDOUT: !115 = !{!114, !114, i64 0} +// CHECK:STDOUT: !63 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !64 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !65 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !66 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !67 = !{!"__libc_errno", !57, i64 0} +// CHECK:STDOUT: !68 = !{!67, !57, i64 0} +// CHECK:STDOUT: !71 = !{null} +// CHECK:STDOUT: !72 = !DISubroutineType(types: !71) +// CHECK:STDOUT: !88 = !DIFile(filename: "variadic_thunk.carbon", directory: "") +// CHECK:STDOUT: !89 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !88, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !90 = !{null, !23} +// CHECK:STDOUT: !91 = !DISubroutineType(types: !90) +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Call1", linkageName: "_CCall1.Main", scope: null, file: !88, line: 10, type: !72, spFlags: DISPFlagDefinition, unit: !89) +// CHECK:STDOUT: !97 = !DILocation(line: 12, column: 11, scope: !96) +// CHECK:STDOUT: !98 = !DILocation(line: 12, column: 3, scope: !96) +// CHECK:STDOUT: !99 = !DILocation(line: 10, column: 1, scope: !96) +// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "Call2", linkageName: "_CCall2.Main", scope: null, file: !88, line: 16, type: !72, spFlags: DISPFlagDefinition, unit: !89) +// CHECK:STDOUT: !101 = !DILocation(line: 18, column: 11, scope: !100) +// CHECK:STDOUT: !102 = !DILocation(line: 18, column: 3, scope: !100) +// CHECK:STDOUT: !103 = !DILocation(line: 16, column: 1, scope: !100) +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "Call3", linkageName: "_CCall3.Main", scope: null, file: !88, line: 22, type: !72, spFlags: DISPFlagDefinition, unit: !89) +// CHECK:STDOUT: !105 = !DILocation(line: 24, column: 11, scope: !104) +// CHECK:STDOUT: !106 = !DILocation(line: 24, column: 3, scope: !104) +// CHECK:STDOUT: !107 = !DILocation(line: 22, column: 1, scope: !104) +// CHECK:STDOUT: !108 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.2d682b12c0c20e08", scope: null, file: !10, line: 32, type: !91, spFlags: DISPFlagDefinition, unit: !89, retainedNodes: !114) +// CHECK:STDOUT: !109 = !DILocalVariable(arg: 1, scope: !108, type: !23) +// CHECK:STDOUT: !113 = !DILocation(line: 32, column: 1, scope: !108) +// CHECK:STDOUT: !114 = !{!109} +// CHECK:STDOUT: !115 = !{!"p1 _ZTS1X", !59, i64 0} +// CHECK:STDOUT: !116 = !{!115, !115, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/thunks.carbon b/toolchain/lower/testdata/interop/cpp/thunks.carbon index 368d6f9ddc10..4d7e2b7face3 100644 --- a/toolchain/lower/testdata/interop/cpp/thunks.carbon +++ b/toolchain/lower/testdata/interop/cpp/thunks.carbon @@ -162,8 +162,8 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: attributes #4 = { "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" } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!35} -// CHECK:STDOUT: !llvm.module.flags = !{!73, !74, !75, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!78} +// CHECK:STDOUT: !llvm.module.flags = !{!73, !74, !75, !76, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!79} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -200,12 +200,13 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: !69 = !{!"any pointer", !68, i64 0} // CHECK:STDOUT: !70 = !{!"p1 _ZTS9NeedThunk", !69, i64 0} // CHECK:STDOUT: !71 = !{!70, !70, i64 0} -// CHECK:STDOUT: !73 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !74 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !75 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !76 = !{!"int", !68, i64 0} -// CHECK:STDOUT: !77 = !{!"__libc_errno", !76, i64 0} -// CHECK:STDOUT: !78 = !{!77, !76, i64 0} +// CHECK:STDOUT: !73 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !74 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !75 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !76 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !77 = !{!"int", !68, i64 0} +// CHECK:STDOUT: !78 = !{!"__libc_errno", !77, i64 0} +// CHECK:STDOUT: !79 = !{!78, !77, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'thunks_for_distinct_specializations.carbon' @@ -214,21 +215,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 !81 { +// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !82 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !86 -// CHECK:STDOUT: %.loc12_35.1.temp = alloca [1 x i8], align 1, !dbg !87 -// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !89 -// CHECK:STDOUT: %.loc13_35.1.temp = alloca [1 x i8], align 1, !dbg !90 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !86 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_35.1.temp), !dbg !87 -// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !87 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !89 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_35.1.temp), !dbg !90 -// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !90 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.d1e44ef097900801(ptr %b2.var), !dbg !89 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.5fbb58cefed751bc(ptr %a2.var), !dbg !86 -// CHECK:STDOUT: ret void, !dbg !92 +// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !87 +// CHECK:STDOUT: %.loc12_35.1.temp = alloca [1 x i8], align 1, !dbg !88 +// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !90 +// CHECK:STDOUT: %.loc13_35.1.temp = alloca [1 x i8], align 1, !dbg !91 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !87 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_35.1.temp), !dbg !88 +// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !88 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !90 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_35.1.temp), !dbg !91 +// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !91 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.d1e44ef097900801(ptr %b2.var), !dbg !90 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.5fbb58cefed751bc(ptr %a2.var), !dbg !87 +// CHECK:STDOUT: ret void, !dbg !93 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -236,19 +237,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 !118 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !118 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !118 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !118 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !119 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !119 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !119 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !119 // 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 weak_odr void @"_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !95 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !96 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !97 -// CHECK:STDOUT: ret void, !dbg !97 +// CHECK:STDOUT: call void @_ZN3BoxI1AEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !98 +// CHECK:STDOUT: ret void, !dbg !98 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -256,19 +257,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 !122 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !122 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !122 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !122 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !123 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !123 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !123 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !123 // 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 weak_odr void @"_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !99 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !100 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !101 -// CHECK:STDOUT: ret void, !dbg !101 +// CHECK:STDOUT: call void @_ZN3BoxI1BEC1ERKS1_.carbon_thunk._(ptr %self, ptr %return), !dbg !102 +// CHECK:STDOUT: ret void, !dbg !102 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind @@ -281,15 +282,15 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // 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 @_CSelfDestruct.Core.d1e44ef097900801(ptr %t) #0 !dbg !103 { -// CHECK:STDOUT: call void @_ZN3BoxI1BED1Ev(ptr %t), !dbg !107 -// CHECK:STDOUT: ret void, !dbg !108 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.d1e44ef097900801(ptr %t) #0 !dbg !104 { +// CHECK:STDOUT: call void @_ZN3BoxI1BED1Ev(ptr %t), !dbg !108 +// CHECK:STDOUT: ret void, !dbg !109 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.5fbb58cefed751bc(ptr %t) #0 !dbg !110 { -// CHECK:STDOUT: call void @_ZN3BoxI1AED1Ev(ptr %t), !dbg !114 -// CHECK:STDOUT: ret void, !dbg !115 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.5fbb58cefed751bc(ptr %t) #0 !dbg !111 { +// CHECK:STDOUT: call void @_ZN3BoxI1AED1Ev(ptr %t), !dbg !115 +// CHECK:STDOUT: ret void, !dbg !116 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @_ZN3BoxI1AEC1ERKS1_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 @@ -306,9 +307,9 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: attributes #5 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!80} -// CHECK:STDOUT: !llvm.module.flags = !{!73, !74, !75, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!78} +// CHECK:STDOUT: !llvm.dbg.cu = !{!81} +// CHECK:STDOUT: !llvm.module.flags = !{!73, !74, !75, !76, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!79} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -323,46 +324,47 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: !67 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !68 = !{!"omnipotent char", !67, i64 0} // CHECK:STDOUT: !69 = !{!"any pointer", !68, i64 0} -// CHECK:STDOUT: !73 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !74 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !75 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !76 = !{!"int", !68, i64 0} -// CHECK:STDOUT: !77 = !{!"__libc_errno", !76, i64 0} -// CHECK:STDOUT: !78 = !{!77, !76, i64 0} -// CHECK:STDOUT: !79 = !DIFile(filename: "thunks_for_distinct_specializations.carbon", directory: "") -// CHECK:STDOUT: !80 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !79, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !79, line: 11, type: !40, spFlags: DISPFlagDefinition, unit: !80, retainedNodes: !93) -// CHECK:STDOUT: !82 = !DILocalVariable(arg: 1, scope: !81, type: !36) -// CHECK:STDOUT: !83 = !DILocalVariable(arg: 2, scope: !81, type: !36) -// CHECK:STDOUT: !86 = !DILocation(line: 12, column: 3, scope: !81) -// CHECK:STDOUT: !87 = !DILocation(line: 12, column: 35, scope: !81) -// CHECK:STDOUT: !89 = !DILocation(line: 13, column: 3, scope: !81) -// CHECK:STDOUT: !90 = !DILocation(line: 13, column: 35, scope: !81) -// CHECK:STDOUT: !92 = !DILocation(line: 11, column: 1, scope: !81) -// CHECK:STDOUT: !93 = !{!82, !83} -// CHECK:STDOUT: !94 = !DIFile(filename: "./box.h", directory: "") -// CHECK:STDOUT: !95 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp", scope: null, file: !94, line: 8, type: !42, spFlags: DISPFlagDefinition, unit: !80, retainedNodes: !98) -// CHECK:STDOUT: !96 = !DILocalVariable(arg: 1, scope: !95, type: !36) -// CHECK:STDOUT: !97 = !DILocation(line: 8, column: 3, scope: !95) -// CHECK:STDOUT: !98 = !{!96} -// CHECK:STDOUT: !99 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp", scope: null, file: !94, line: 8, type: !42, spFlags: DISPFlagDefinition, unit: !80, retainedNodes: !102) -// CHECK:STDOUT: !100 = !DILocalVariable(arg: 1, scope: !99, type: !36) -// CHECK:STDOUT: !101 = !DILocation(line: 8, column: 3, scope: !99) -// CHECK:STDOUT: !102 = !{!100} -// CHECK:STDOUT: !103 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.d1e44ef097900801", scope: null, file: !26, line: 32, type: !38, spFlags: DISPFlagDefinition, unit: !80, retainedNodes: !109) -// CHECK:STDOUT: !104 = !DILocalVariable(arg: 1, scope: !103, type: !36) -// CHECK:STDOUT: !107 = !DILocation(line: 34, column: 5, scope: !103) -// CHECK:STDOUT: !108 = !DILocation(line: 32, column: 1, scope: !103) -// CHECK:STDOUT: !109 = !{!104} -// CHECK:STDOUT: !110 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.5fbb58cefed751bc", scope: null, file: !26, line: 32, type: !38, spFlags: DISPFlagDefinition, unit: !80, retainedNodes: !116) -// CHECK:STDOUT: !111 = !DILocalVariable(arg: 1, scope: !110, type: !36) -// CHECK:STDOUT: !114 = !DILocation(line: 34, column: 5, scope: !110) -// CHECK:STDOUT: !115 = !DILocation(line: 32, column: 1, scope: !110) -// CHECK:STDOUT: !116 = !{!111} -// CHECK:STDOUT: !117 = !{!"p1 _ZTS3BoxI1AE", !69, i64 0} -// CHECK:STDOUT: !118 = !{!117, !117, i64 0} -// CHECK:STDOUT: !121 = !{!"p1 _ZTS3BoxI1BE", !69, i64 0} -// CHECK:STDOUT: !122 = !{!121, !121, i64 0} +// CHECK:STDOUT: !73 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !74 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !75 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !76 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !77 = !{!"int", !68, i64 0} +// CHECK:STDOUT: !78 = !{!"__libc_errno", !77, i64 0} +// CHECK:STDOUT: !79 = !{!78, !77, i64 0} +// CHECK:STDOUT: !80 = !DIFile(filename: "thunks_for_distinct_specializations.carbon", directory: "") +// CHECK:STDOUT: !81 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !80, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !82 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !80, line: 11, type: !40, spFlags: DISPFlagDefinition, unit: !81, retainedNodes: !94) +// CHECK:STDOUT: !83 = !DILocalVariable(arg: 1, scope: !82, type: !36) +// CHECK:STDOUT: !84 = !DILocalVariable(arg: 2, scope: !82, type: !36) +// CHECK:STDOUT: !87 = !DILocation(line: 12, column: 3, scope: !82) +// CHECK:STDOUT: !88 = !DILocation(line: 12, column: 35, scope: !82) +// CHECK:STDOUT: !90 = !DILocation(line: 13, column: 3, scope: !82) +// CHECK:STDOUT: !91 = !DILocation(line: 13, column: 35, scope: !82) +// CHECK:STDOUT: !93 = !DILocation(line: 11, column: 1, scope: !82) +// CHECK:STDOUT: !94 = !{!83, !84} +// CHECK:STDOUT: !95 = !DIFile(filename: "./box.h", directory: "") +// CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.c0735c73762b4d1c.Core:Box.Cpp", scope: null, file: !95, line: 8, type: !42, spFlags: DISPFlagDefinition, unit: !81, retainedNodes: !99) +// CHECK:STDOUT: !97 = !DILocalVariable(arg: 1, scope: !96, type: !36) +// CHECK:STDOUT: !98 = !DILocation(line: 8, column: 3, scope: !96) +// CHECK:STDOUT: !99 = !{!97} +// CHECK:STDOUT: !100 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.2c1dd62357f2b914.Core:Box.Cpp", scope: null, file: !95, line: 8, type: !42, spFlags: DISPFlagDefinition, unit: !81, retainedNodes: !103) +// CHECK:STDOUT: !101 = !DILocalVariable(arg: 1, scope: !100, type: !36) +// CHECK:STDOUT: !102 = !DILocation(line: 8, column: 3, scope: !100) +// CHECK:STDOUT: !103 = !{!101} +// CHECK:STDOUT: !104 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.d1e44ef097900801", scope: null, file: !26, line: 32, type: !38, spFlags: DISPFlagDefinition, unit: !81, retainedNodes: !110) +// CHECK:STDOUT: !105 = !DILocalVariable(arg: 1, scope: !104, type: !36) +// CHECK:STDOUT: !108 = !DILocation(line: 34, column: 5, scope: !104) +// CHECK:STDOUT: !109 = !DILocation(line: 32, column: 1, scope: !104) +// CHECK:STDOUT: !110 = !{!105} +// CHECK:STDOUT: !111 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.5fbb58cefed751bc", scope: null, file: !26, line: 32, type: !38, spFlags: DISPFlagDefinition, unit: !81, retainedNodes: !117) +// CHECK:STDOUT: !112 = !DILocalVariable(arg: 1, scope: !111, type: !36) +// CHECK:STDOUT: !115 = !DILocation(line: 34, column: 5, scope: !111) +// CHECK:STDOUT: !116 = !DILocation(line: 32, column: 1, scope: !111) +// CHECK:STDOUT: !117 = !{!112} +// CHECK:STDOUT: !118 = !{!"p1 _ZTS3BoxI1AE", !69, i64 0} +// CHECK:STDOUT: !119 = !{!118, !118, i64 0} +// CHECK:STDOUT: !122 = !{!"p1 _ZTS3BoxI1BE", !69, i64 0} +// CHECK:STDOUT: !123 = !{!122, !122, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'thunks_for_anonymous_namespace_collision.carbon' @@ -375,21 +377,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 !127 { +// CHECK:STDOUT: define void @_CCall.Main(ptr %a, ptr %b) #0 !dbg !128 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !132 -// CHECK:STDOUT: %.loc12_32.1.temp = alloca [1 x i8], align 1, !dbg !133 -// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !135 -// CHECK:STDOUT: %.loc13_36.1.temp = alloca [1 x i8], align 1, !dbg !136 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !132 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_32.1.temp), !dbg !133 -// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !133 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !135 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_36.1.temp), !dbg !136 -// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !136 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.c89f00da2163eb95(ptr %b2.var), !dbg !135 -// CHECK:STDOUT: call void @_CSelfDestruct.Core.0b81af486af557dc(ptr %a2.var), !dbg !132 -// CHECK:STDOUT: ret void, !dbg !138 +// CHECK:STDOUT: %a2.var = alloca [1 x i8], align 1, !dbg !133 +// CHECK:STDOUT: %.loc12_32.1.temp = alloca [1 x i8], align 1, !dbg !134 +// CHECK:STDOUT: %b2.var = alloca [1 x i8], align 1, !dbg !136 +// CHECK:STDOUT: %.loc13_36.1.temp = alloca [1 x i8], align 1, !dbg !137 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a2.var), !dbg !133 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_32.1.temp), !dbg !134 +// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %a, ptr %a2.var), !dbg !134 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %b2.var), !dbg !136 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc13_36.1.temp), !dbg !137 +// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %b, ptr %b2.var), !dbg !137 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.c89f00da2163eb95(ptr %b2.var), !dbg !136 +// CHECK:STDOUT: call void @_CSelfDestruct.Core.0b81af486af557dc(ptr %a2.var), !dbg !133 +// CHECK:STDOUT: ret void, !dbg !139 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -397,19 +399,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 !164 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !164 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !164 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !164 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !165 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !165 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !165 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !165 // 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 weak_odr void @"_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !141 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !142 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !143 -// CHECK:STDOUT: ret void, !dbg !143 +// CHECK:STDOUT: call void @_ZN7CollideC1ERKS_.carbon_thunk._(ptr %self, ptr %return), !dbg !144 +// CHECK:STDOUT: ret void, !dbg !144 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable @@ -417,26 +419,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 !167 -// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !167 -// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !167 -// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !167 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !168 +// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !168 +// CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !168 +// CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !168 // 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 weak_odr void @"_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !145 { +// CHECK:STDOUT: define weak_odr void @"_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp"(ptr sret([1 x i8]) %return, ptr %self) #2 !dbg !146 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %self, ptr %return), !dbg !147 -// CHECK:STDOUT: ret void, !dbg !147 +// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideC1ERKS0_.carbon_thunk._(ptr %self, ptr %return), !dbg !148 +// CHECK:STDOUT: ret void, !dbg !148 // 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 !167 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !168 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -445,7 +447,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 !164 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !165 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -454,15 +456,15 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // 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 @_CSelfDestruct.Core.c89f00da2163eb95(ptr %t) #0 !dbg !149 { -// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideD2Ev(ptr %t), !dbg !153 -// CHECK:STDOUT: ret void, !dbg !154 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.c89f00da2163eb95(ptr %t) #0 !dbg !150 { +// CHECK:STDOUT: call void @_ZN12_GLOBAL__N_17CollideD2Ev(ptr %t), !dbg !154 +// CHECK:STDOUT: ret void, !dbg !155 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.0b81af486af557dc(ptr %t) #0 !dbg !156 { -// CHECK:STDOUT: call void @_ZN7CollideD2Ev(ptr %t), !dbg !160 -// CHECK:STDOUT: ret void, !dbg !161 +// CHECK:STDOUT: define linkonce_odr void @_CSelfDestruct.Core.0b81af486af557dc(ptr %t) #0 !dbg !157 { +// CHECK:STDOUT: call void @_ZN7CollideD2Ev(ptr %t), !dbg !161 +// CHECK:STDOUT: ret void, !dbg !162 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable @@ -470,8 +472,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 !164 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !164 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !165 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !165 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -481,8 +483,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 !167 -// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !167 +// CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !168 +// CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !168 // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -496,9 +498,9 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: attributes #3 = { 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" } // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!126} -// CHECK:STDOUT: !llvm.module.flags = !{!73, !74, !75, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!78} +// CHECK:STDOUT: !llvm.dbg.cu = !{!127} +// CHECK:STDOUT: !llvm.module.flags = !{!73, !74, !75, !76, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!79} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -513,44 +515,45 @@ fn Call(a: Cpp.Collide, b: Cpp.AnonCollide) { // CHECK:STDOUT: !67 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !68 = !{!"omnipotent char", !67, i64 0} // CHECK:STDOUT: !69 = !{!"any pointer", !68, i64 0} -// CHECK:STDOUT: !73 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !74 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !75 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !76 = !{!"int", !68, i64 0} -// CHECK:STDOUT: !77 = !{!"__libc_errno", !76, i64 0} -// CHECK:STDOUT: !78 = !{!77, !76, i64 0} -// CHECK:STDOUT: !125 = !DIFile(filename: "thunks_for_anonymous_namespace_collision.carbon", directory: "") -// CHECK:STDOUT: !126 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !125, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !127 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !125, line: 11, type: !40, spFlags: DISPFlagDefinition, unit: !126, retainedNodes: !139) -// CHECK:STDOUT: !128 = !DILocalVariable(arg: 1, scope: !127, type: !36) -// CHECK:STDOUT: !129 = !DILocalVariable(arg: 2, scope: !127, type: !36) -// CHECK:STDOUT: !132 = !DILocation(line: 12, column: 3, scope: !127) -// CHECK:STDOUT: !133 = !DILocation(line: 12, column: 32, scope: !127) -// CHECK:STDOUT: !135 = !DILocation(line: 13, column: 3, scope: !127) -// CHECK:STDOUT: !136 = !DILocation(line: 13, column: 36, scope: !127) -// CHECK:STDOUT: !138 = !DILocation(line: 11, column: 1, scope: !127) -// CHECK:STDOUT: !139 = !{!128, !129} -// CHECK:STDOUT: !140 = !DIFile(filename: "./anonymous_namespace_collision.h", directory: "") -// CHECK:STDOUT: !141 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp", scope: null, file: !140, line: 17, type: !42, spFlags: DISPFlagDefinition, unit: !126, retainedNodes: !144) -// CHECK:STDOUT: !142 = !DILocalVariable(arg: 1, scope: !141, type: !36) -// CHECK:STDOUT: !143 = !DILocation(line: 17, column: 3, scope: !141) -// CHECK:STDOUT: !144 = !{!142} -// CHECK:STDOUT: !145 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp", scope: null, file: !140, line: 8, type: !42, spFlags: DISPFlagDefinition, unit: !126, retainedNodes: !148) -// CHECK:STDOUT: !146 = !DILocalVariable(arg: 1, scope: !145, type: !36) -// CHECK:STDOUT: !147 = !DILocation(line: 8, column: 3, scope: !145) -// CHECK:STDOUT: !148 = !{!146} -// CHECK:STDOUT: !149 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.c89f00da2163eb95", scope: null, file: !26, line: 32, type: !38, spFlags: DISPFlagDefinition, unit: !126, retainedNodes: !155) -// CHECK:STDOUT: !150 = !DILocalVariable(arg: 1, scope: !149, type: !36) -// CHECK:STDOUT: !153 = !DILocation(line: 34, column: 5, scope: !149) -// CHECK:STDOUT: !154 = !DILocation(line: 32, column: 1, scope: !149) -// CHECK:STDOUT: !155 = !{!150} -// CHECK:STDOUT: !156 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.0b81af486af557dc", scope: null, file: !26, line: 32, type: !38, spFlags: DISPFlagDefinition, unit: !126, retainedNodes: !162) -// CHECK:STDOUT: !157 = !DILocalVariable(arg: 1, scope: !156, type: !36) -// CHECK:STDOUT: !160 = !DILocation(line: 34, column: 5, scope: !156) -// CHECK:STDOUT: !161 = !DILocation(line: 32, column: 1, scope: !156) -// CHECK:STDOUT: !162 = !{!157} -// CHECK:STDOUT: !163 = !{!"p1 _ZTS7Collide", !69, i64 0} -// CHECK:STDOUT: !164 = !{!163, !163, i64 0} -// CHECK:STDOUT: !166 = !{!"p1 _ZTSN12_GLOBAL__N_17CollideE", !69, i64 0} -// CHECK:STDOUT: !167 = !{!166, !166, i64 0} +// CHECK:STDOUT: !73 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !74 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !75 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !76 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !77 = !{!"int", !68, i64 0} +// CHECK:STDOUT: !78 = !{!"__libc_errno", !77, i64 0} +// CHECK:STDOUT: !79 = !{!78, !77, i64 0} +// CHECK:STDOUT: !126 = !DIFile(filename: "thunks_for_anonymous_namespace_collision.carbon", directory: "") +// CHECK:STDOUT: !127 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !126, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !128 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !126, line: 11, type: !40, spFlags: DISPFlagDefinition, unit: !127, retainedNodes: !140) +// CHECK:STDOUT: !129 = !DILocalVariable(arg: 1, scope: !128, type: !36) +// CHECK:STDOUT: !130 = !DILocalVariable(arg: 2, scope: !128, type: !36) +// CHECK:STDOUT: !133 = !DILocation(line: 12, column: 3, scope: !128) +// CHECK:STDOUT: !134 = !DILocation(line: 12, column: 32, scope: !128) +// CHECK:STDOUT: !136 = !DILocation(line: 13, column: 3, scope: !128) +// CHECK:STDOUT: !137 = !DILocation(line: 13, column: 36, scope: !128) +// CHECK:STDOUT: !139 = !DILocation(line: 11, column: 1, scope: !128) +// CHECK:STDOUT: !140 = !{!129, !130} +// CHECK:STDOUT: !141 = !DIFile(filename: "./anonymous_namespace_collision.h", directory: "") +// CHECK:STDOUT: !142 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.9e522bb4dbf82e5c.Core:Collide.Cpp", scope: null, file: !141, line: 17, type: !42, spFlags: DISPFlagDefinition, unit: !127, retainedNodes: !145) +// CHECK:STDOUT: !143 = !DILocalVariable(arg: 1, scope: !142, type: !36) +// CHECK:STDOUT: !144 = !DILocation(line: 17, column: 3, scope: !142) +// CHECK:STDOUT: !145 = !{!143} +// CHECK:STDOUT: !146 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk:Copy.d1fe27f3241437fa.Core:Collide..Cpp", scope: null, file: !141, line: 8, type: !42, spFlags: DISPFlagDefinition, unit: !127, retainedNodes: !149) +// CHECK:STDOUT: !147 = !DILocalVariable(arg: 1, scope: !146, type: !36) +// CHECK:STDOUT: !148 = !DILocation(line: 8, column: 3, scope: !146) +// CHECK:STDOUT: !149 = !{!147} +// CHECK:STDOUT: !150 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.c89f00da2163eb95", scope: null, file: !26, line: 32, type: !38, spFlags: DISPFlagDefinition, unit: !127, retainedNodes: !156) +// CHECK:STDOUT: !151 = !DILocalVariable(arg: 1, scope: !150, type: !36) +// CHECK:STDOUT: !154 = !DILocation(line: 34, column: 5, scope: !150) +// CHECK:STDOUT: !155 = !DILocation(line: 32, column: 1, scope: !150) +// CHECK:STDOUT: !156 = !{!151} +// CHECK:STDOUT: !157 = distinct !DISubprogram(name: "SelfDestruct", linkageName: "_CSelfDestruct.Core.0b81af486af557dc", scope: null, file: !26, line: 32, type: !38, spFlags: DISPFlagDefinition, unit: !127, retainedNodes: !163) +// CHECK:STDOUT: !158 = !DILocalVariable(arg: 1, scope: !157, type: !36) +// CHECK:STDOUT: !161 = !DILocation(line: 34, column: 5, scope: !157) +// CHECK:STDOUT: !162 = !DILocation(line: 32, column: 1, scope: !157) +// CHECK:STDOUT: !163 = !{!158} +// CHECK:STDOUT: !164 = !{!"p1 _ZTS7Collide", !69, i64 0} +// CHECK:STDOUT: !165 = !{!164, !164, i64 0} +// CHECK:STDOUT: !167 = !{!"p1 _ZTSN12_GLOBAL__N_17CollideE", !69, i64 0} +// CHECK:STDOUT: !168 = !{!167, !167, i64 0} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/void.carbon b/toolchain/lower/testdata/interop/cpp/void.carbon index 32ba0409d228..5e3da288ff4e 100644 --- a/toolchain/lower/testdata/interop/cpp/void.carbon +++ b/toolchain/lower/testdata/interop/cpp/void.carbon @@ -250,8 +250,8 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: attributes #3 = { alwaysinline nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!5} -// CHECK:STDOUT: !llvm.module.flags = !{!205, !206, !207, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!212} +// CHECK:STDOUT: !llvm.module.flags = !{!205, !206, !207, !208, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!213} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} @@ -373,14 +373,15 @@ fn ConvertFromConstVoidPtr(p: const Cpp.void*) -> const i32* { // CHECK:STDOUT: !199 = !DILocalVariable(arg: 1, scope: !198, type: !7) // CHECK:STDOUT: !203 = !DILocation(line: 36, column: 1, scope: !198) // CHECK:STDOUT: !204 = !{!199} -// CHECK:STDOUT: !205 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !206 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !207 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !208 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !209 = !{!"omnipotent char", !208, i64 0} -// CHECK:STDOUT: !210 = !{!"int", !209, i64 0} -// CHECK:STDOUT: !211 = !{!"__libc_errno", !210, i64 0} -// CHECK:STDOUT: !212 = !{!211, !210, i64 0} +// CHECK:STDOUT: !205 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !206 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !207 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !208 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !209 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !210 = !{!"omnipotent char", !209, i64 0} +// CHECK:STDOUT: !211 = !{!"int", !210, i64 0} +// CHECK:STDOUT: !212 = !{!"__libc_errno", !211, i64 0} +// CHECK:STDOUT: !213 = !{!212, !211, i64 0} // CHECK:STDOUT: // CHECK:STDOUT: ; --- // CHECK:STDOUT: ; ModuleID = 'receive.carbon' @@ -389,59 +390,60 @@ 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 !217 { +// CHECK:STDOUT: define ptr @_CReceiveVoidPtr.Main() #0 !dbg !218 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %return_void_ptr.call = call ptr @_Z15return_void_ptrv(), !dbg !220 -// CHECK:STDOUT: ret ptr %return_void_ptr.call, !dbg !221 +// CHECK:STDOUT: %return_void_ptr.call = call ptr @_Z15return_void_ptrv(), !dbg !221 +// CHECK:STDOUT: ret ptr %return_void_ptr.call, !dbg !222 // 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 !222 { +// CHECK:STDOUT: define ptr @_CConvertFromVoidPtr.Main(ptr %p) #0 !dbg !223 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr %p, !dbg !228 +// CHECK:STDOUT: ret ptr %p, !dbg !229 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind -// CHECK:STDOUT: define ptr @_CConvertFromConstVoidPtr.Main(ptr %p) #0 !dbg !230 { +// CHECK:STDOUT: define ptr @_CConvertFromConstVoidPtr.Main(ptr %p) #0 !dbg !231 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: ret ptr %p, !dbg !236 +// CHECK:STDOUT: ret ptr %p, !dbg !237 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nounwind } // CHECK:STDOUT: attributes #1 = { "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" } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!214} -// CHECK:STDOUT: !llvm.module.flags = !{!205, !206, !207, !2, !3} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!212} +// CHECK:STDOUT: !llvm.dbg.cu = !{!215} +// CHECK:STDOUT: !llvm.module.flags = !{!205, !206, !207, !208, !2, !3} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!213} // CHECK:STDOUT: // CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !7 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64) // CHECK:STDOUT: !14 = !{!7, !7} // CHECK:STDOUT: !15 = !DISubroutineType(types: !14) -// CHECK:STDOUT: !205 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !206 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !207 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !208 = !{!"Simple C++ TBAA"} -// CHECK:STDOUT: !209 = !{!"omnipotent char", !208, i64 0} -// CHECK:STDOUT: !210 = !{!"int", !209, i64 0} -// CHECK:STDOUT: !211 = !{!"__libc_errno", !210, i64 0} -// CHECK:STDOUT: !212 = !{!211, !210, i64 0} -// CHECK:STDOUT: !213 = !DIFile(filename: "receive.carbon", directory: "") -// CHECK:STDOUT: !214 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !213, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !215 = !{!7} -// CHECK:STDOUT: !216 = !DISubroutineType(types: !215) -// CHECK:STDOUT: !217 = distinct !DISubprogram(name: "ReceiveVoidPtr", linkageName: "_CReceiveVoidPtr.Main", scope: null, file: !213, line: 6, type: !216, spFlags: DISPFlagDefinition, unit: !214) -// CHECK:STDOUT: !220 = !DILocation(line: 7, column: 10, scope: !217) -// CHECK:STDOUT: !221 = !DILocation(line: 7, column: 3, scope: !217) -// CHECK:STDOUT: !222 = distinct !DISubprogram(name: "ConvertFromVoidPtr", linkageName: "_CConvertFromVoidPtr.Main", scope: null, file: !213, line: 10, type: !15, spFlags: DISPFlagDefinition, unit: !214, retainedNodes: !229) -// CHECK:STDOUT: !223 = !DILocalVariable(arg: 1, scope: !222, type: !7) -// CHECK:STDOUT: !228 = !DILocation(line: 11, column: 3, scope: !222) -// CHECK:STDOUT: !229 = !{!223} -// CHECK:STDOUT: !230 = distinct !DISubprogram(name: "ConvertFromConstVoidPtr", linkageName: "_CConvertFromConstVoidPtr.Main", scope: null, file: !213, line: 14, type: !15, spFlags: DISPFlagDefinition, unit: !214, retainedNodes: !237) -// CHECK:STDOUT: !231 = !DILocalVariable(arg: 1, scope: !230, type: !7) -// CHECK:STDOUT: !236 = !DILocation(line: 15, column: 3, scope: !230) -// CHECK:STDOUT: !237 = !{!231} +// CHECK:STDOUT: !205 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !206 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !207 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !208 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !209 = !{!"Simple C++ TBAA"} +// CHECK:STDOUT: !210 = !{!"omnipotent char", !209, i64 0} +// CHECK:STDOUT: !211 = !{!"int", !210, i64 0} +// CHECK:STDOUT: !212 = !{!"__libc_errno", !211, i64 0} +// CHECK:STDOUT: !213 = !{!212, !211, i64 0} +// CHECK:STDOUT: !214 = !DIFile(filename: "receive.carbon", directory: "") +// CHECK:STDOUT: !215 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !214, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !216 = !{!7} +// CHECK:STDOUT: !217 = !DISubroutineType(types: !216) +// CHECK:STDOUT: !218 = distinct !DISubprogram(name: "ReceiveVoidPtr", linkageName: "_CReceiveVoidPtr.Main", scope: null, file: !214, line: 6, type: !217, spFlags: DISPFlagDefinition, unit: !215) +// CHECK:STDOUT: !221 = !DILocation(line: 7, column: 10, scope: !218) +// CHECK:STDOUT: !222 = !DILocation(line: 7, column: 3, scope: !218) +// CHECK:STDOUT: !223 = distinct !DISubprogram(name: "ConvertFromVoidPtr", linkageName: "_CConvertFromVoidPtr.Main", scope: null, file: !214, line: 10, type: !15, spFlags: DISPFlagDefinition, unit: !215, retainedNodes: !230) +// CHECK:STDOUT: !224 = !DILocalVariable(arg: 1, scope: !223, type: !7) +// CHECK:STDOUT: !229 = !DILocation(line: 11, column: 3, scope: !223) +// CHECK:STDOUT: !230 = !{!224} +// CHECK:STDOUT: !231 = distinct !DISubprogram(name: "ConvertFromConstVoidPtr", linkageName: "_CConvertFromConstVoidPtr.Main", scope: null, file: !214, line: 14, type: !15, spFlags: DISPFlagDefinition, unit: !215, retainedNodes: !238) +// CHECK:STDOUT: !232 = !DILocalVariable(arg: 1, scope: !231, type: !7) +// CHECK:STDOUT: !237 = !DILocation(line: 15, column: 3, scope: !231) +// CHECK:STDOUT: !238 = !{!232} // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/var/export.carbon b/toolchain/lower/testdata/var/export.carbon index 2028651da882..f9e1460d20d3 100644 --- a/toolchain/lower/testdata/var/export.carbon +++ b/toolchain/lower/testdata/var/export.carbon @@ -61,8 +61,8 @@ fn Run() -> i32 { // CHECK:STDOUT: attributes #1 = { nounwind } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.dbg.cu = !{!23} -// CHECK:STDOUT: !llvm.module.flags = !{!37, !38, !39, !6, !7} -// CHECK:STDOUT: !llvm.errno.tbaa = !{!41} +// CHECK:STDOUT: !llvm.module.flags = !{!37, !38, !39, !40, !6, !7} +// CHECK:STDOUT: !llvm.errno.tbaa = !{!42} // CHECK:STDOUT: // CHECK:STDOUT: !0 = !{!"Simple C++ TBAA"} // CHECK:STDOUT: !1 = !{!"omnipotent char", !0, i64 0} @@ -83,9 +83,10 @@ fn Run() -> i32 { // CHECK:STDOUT: !34 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !22, type: !33, spFlags: DISPFlagDefinition, unit: !23) // CHECK:STDOUT: !35 = !DILocation(line: 5, column: 1, scope: !34) // CHECK:STDOUT: !36 = !DILocation(line: 0, scope: !34) -// CHECK:STDOUT: !37 = !{i32 8, !"PIC Level", i32 2} -// CHECK:STDOUT: !38 = !{i32 7, !"PIE Level", i32 2} -// CHECK:STDOUT: !39 = !{i32 7, !"uwtable", i32 2} -// CHECK:STDOUT: !40 = !{!"__libc_errno", !2, i64 0} -// CHECK:STDOUT: !41 = !{!40, !2, i64 0} +// CHECK:STDOUT: !37 = !{i32 2, !"debugger-tuning", !"gdb"} +// CHECK:STDOUT: !38 = !{i32 8, !"PIC Level", i32 2} +// CHECK:STDOUT: !39 = !{i32 7, !"PIE Level", i32 2} +// CHECK:STDOUT: !40 = !{i32 7, !"uwtable", i32 2} +// CHECK:STDOUT: !41 = !{!"__libc_errno", !2, i64 0} +// CHECK:STDOUT: !42 = !{!41, !2, i64 0} // CHECK:STDOUT: