From a835f50b290034cafa2a5ad4604dcee20bca0dd7 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 15 Aug 2024 23:42:33 +0000 Subject: [PATCH 01/11] Add rudimentry debug info metadata emission This adds just the debug info metadata for Compilation Units (the top level container of debug info) - but without anything in them, LLVM won't emit them at all, so while this is testable at the IR level, it isn't observable at the object level until more debug info is added. --- toolchain/driver/driver.cpp | 20 ++++++++++++++-- toolchain/lower/file_context.cpp | 24 +++++++++++++++++-- toolchain/lower/file_context.h | 11 ++++++++- toolchain/lower/handle.cpp | 1 + toolchain/lower/lower.cpp | 9 +++---- toolchain/lower/lower.h | 5 ++-- toolchain/lower/testdata/alias/local.carbon | 8 +++++++ .../testdata/array/array_in_place.carbon | 8 +++++++ .../testdata/array/assign_return_value.carbon | 8 +++++++ toolchain/lower/testdata/array/base.carbon | 8 +++++++ .../testdata/array/function_param.carbon | 8 +++++++ toolchain/lower/testdata/basics/empty.carbon | 8 +++++++ .../lower/testdata/basics/false_true.carbon | 8 +++++++ .../lower/testdata/basics/int_types.carbon | 8 +++++++ .../testdata/basics/numeric_literals.carbon | 8 +++++++ .../lower/testdata/basics/type_values.carbon | 8 +++++++ toolchain/lower/testdata/basics/zero.carbon | 8 +++++++ .../lower/testdata/builtins/float.carbon | 8 +++++++ toolchain/lower/testdata/builtins/int.carbon | 8 +++++++ .../builtins/method_vs_nonmethod.carbon | 8 +++++++ .../builtins/overloaded_operator.carbon | 8 +++++++ .../lower/testdata/builtins/print.carbon | 8 +++++++ .../lower/testdata/builtins/types.carbon | 8 +++++++ toolchain/lower/testdata/builtins/uint.carbon | 8 +++++++ toolchain/lower/testdata/class/adapt.carbon | 16 +++++++++++++ toolchain/lower/testdata/class/base.carbon | 8 +++++++ toolchain/lower/testdata/class/basic.carbon | 8 +++++++ toolchain/lower/testdata/class/field.carbon | 8 +++++++ toolchain/lower/testdata/class/method.carbon | 8 +++++++ toolchain/lower/testdata/class/self.carbon | 8 +++++++ .../lower/testdata/class/value_access.carbon | 8 +++++++ .../function/call/empty_struct.carbon | 8 +++++++ .../testdata/function/call/empty_tuple.carbon | 8 +++++++ .../lower/testdata/function/call/i32.carbon | 8 +++++++ .../call/implicit_empty_tuple_as_arg.carbon | 8 +++++++ .../testdata/function/call/params_one.carbon | 8 +++++++ .../function/call/params_one_comma.carbon | 8 +++++++ .../testdata/function/call/params_two.carbon | 8 +++++++ .../function/call/params_two_comma.carbon | 8 +++++++ .../testdata/function/call/params_zero.carbon | 8 +++++++ .../function/call/return_implicit.carbon | 8 +++++++ .../function/call/struct_param.carbon | 8 +++++++ .../testdata/function/call/tuple_param.carbon | 8 +++++++ .../call/tuple_param_with_return_slot.carbon | 8 +++++++ .../testdata/function/call/var_param.carbon | 8 +++++++ .../function/declaration/simple.carbon | 8 +++++++ .../function/definition/empty_struct.carbon | 8 +++++++ .../function/definition/params_one.carbon | 8 +++++++ .../function/definition/params_two.carbon | 8 +++++++ .../function/definition/params_zero.carbon | 8 +++++++ .../function/generic/type_param.carbon | 8 +++++++ toolchain/lower/testdata/if/else.carbon | 8 +++++++ toolchain/lower/testdata/if/no_else.carbon | 8 +++++++ toolchain/lower/testdata/if_expr/basic.carbon | 8 +++++++ .../lower/testdata/if_expr/empty_block.carbon | 8 +++++++ .../lower/testdata/impl/assoc_fn_alias.carbon | 8 +++++++ .../lower/testdata/impl/extend_impl.carbon | 8 +++++++ toolchain/lower/testdata/impl/impl.carbon | 8 +++++++ .../testdata/impl/instance_method.carbon | 8 +++++++ .../index/array_element_access.carbon | 8 +++++++ .../index/tuple_element_access.carbon | 8 +++++++ .../index/tuple_return_value_access.carbon | 8 +++++++ .../lower/testdata/interface/assoc.carbon | 8 +++++++ .../lower/testdata/interface/basic.carbon | 8 +++++++ toolchain/lower/testdata/let/local.carbon | 8 +++++++ toolchain/lower/testdata/let/tuple.carbon | 8 +++++++ .../lower/testdata/namespace/function.carbon | 8 +++++++ .../lower/testdata/namespace/nested.carbon | 8 +++++++ toolchain/lower/testdata/operators/and.carbon | 8 +++++++ .../testdata/operators/and_empty_block.carbon | 8 +++++++ .../testdata/operators/assignment.carbon | 8 +++++++ toolchain/lower/testdata/operators/not.carbon | 8 +++++++ toolchain/lower/testdata/operators/or.carbon | 8 +++++++ .../testdata/operators/or_empty_block.carbon | 8 +++++++ .../testdata/operators/overloaded.carbon | 8 +++++++ .../packages/cross_package_call.carbon | 16 +++++++++++++ .../testdata/pointer/address_of_field.carbon | 8 +++++++ .../testdata/pointer/address_of_unused.carbon | 8 +++++++ toolchain/lower/testdata/pointer/basic.carbon | 8 +++++++ .../pointer/pointer_to_pointer.carbon | 8 +++++++ .../testdata/return/code_after_return.carbon | 8 +++++++ .../lower/testdata/return/no_value.carbon | 8 +++++++ .../lower/testdata/return/return_var.carbon | 8 +++++++ .../testdata/return/return_var_byval.carbon | 8 +++++++ toolchain/lower/testdata/return/value.carbon | 8 +++++++ toolchain/lower/testdata/return/var.carbon | 8 +++++++ toolchain/lower/testdata/struct/empty.carbon | 8 +++++++ .../testdata/struct/member_access.carbon | 8 +++++++ .../testdata/struct/nested_struct.carbon | 8 +++++++ .../struct/nested_struct_in_place.carbon | 8 +++++++ .../lower/testdata/struct/one_entry.carbon | 8 +++++++ .../lower/testdata/struct/two_entries.carbon | 8 +++++++ toolchain/lower/testdata/tuple/empty.carbon | 8 +++++++ .../lower/testdata/tuple/nested_tuple.carbon | 8 +++++++ .../tuple/nested_tuple_in_place.carbon | 8 +++++++ .../lower/testdata/tuple/one_entry.carbon | 8 +++++++ .../lower/testdata/tuple/two_entries.carbon | 8 +++++++ .../testdata/tuple/value_formation.carbon | 8 +++++++ .../testdata/tuple/value_forwarding.carbon | 8 +++++++ toolchain/lower/testdata/var/local.carbon | 8 +++++++ .../testdata/while/break_continue.carbon | 8 +++++++ .../lower/testdata/while/preheader.carbon | 8 +++++++ .../testdata/while/unreachable_end.carbon | 8 +++++++ toolchain/lower/testdata/while/while.carbon | 8 +++++++ toolchain/testing/file_test.cpp | 1 + 105 files changed, 860 insertions(+), 11 deletions(-) diff --git a/toolchain/driver/driver.cpp b/toolchain/driver/driver.cpp index cd388b062c14b..6b6e8714753f1 100644 --- a/toolchain/driver/driver.cpp +++ b/toolchain/driver/driver.cpp @@ -337,6 +337,14 @@ Excludes files with the given prefix from dumps. )""", }, [&](auto& arg_b) { arg_b.Set(&exclude_dump_file_prefix); }); + b.AddFlag( + { + .name = "debug-info", + .help = R"""( +Emit DWARF debug information. +)""", + }, + [&](auto& arg_b) { arg_b.Set(&include_debug_info); }); } Phase phase; @@ -358,6 +366,7 @@ Excludes files with the given prefix from dumps. bool preorder_parse_tree = false; bool builtin_sem_ir = false; bool prelude_import = false; + bool include_debug_info = false; llvm::StringRef exclude_dump_file_prefix; }; @@ -523,6 +532,12 @@ auto Driver::ValidateCompileOptions(const CompileOptions& options) const << options.phase << "'.\n"; return false; } + if (options.include_debug_info) { + error_stream_ + << "ERROR: Requested debug info but compile phase is limited to '" + << options.phase << "'.\n"; + return false; + } [[fallthrough]]; case Phase::Lower: case Phase::CodeGen: @@ -676,8 +691,9 @@ class Driver::CompilationUnit { // TODO: Consider disabling instruction naming by default if we're not // producing textual LLVM IR. SemIR::InstNamer inst_namer(*tokens_, *parse_tree_, *sem_ir_); - module_ = Lower::LowerToLLVM(*llvm_context_, input_filename_, *sem_ir_, - &inst_namer, vlog_stream_); + module_ = Lower::LowerToLLVM(*llvm_context_, options_.include_debug_info, + input_filename_, *sem_ir_, &inst_namer, + vlog_stream_); }); if (vlog_stream_) { CARBON_VLOG() << "*** llvm::Module ***\n"; diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index ae264c64677d3..5f8d1b4908fd1 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -20,16 +20,20 @@ namespace Carbon::Lower { FileContext::FileContext(llvm::LLVMContext& llvm_context, - llvm::StringRef module_name, const SemIR::File& sem_ir, + bool include_debug_info, llvm::StringRef module_name, + const SemIR::File& sem_ir, const SemIR::InstNamer* inst_namer, llvm::raw_ostream* vlog_stream) : llvm_context_(&llvm_context), llvm_module_(std::make_unique(module_name, llvm_context)), + di_builder_(*llvm_module_), sem_ir_(&sem_ir), inst_namer_(inst_namer), - vlog_stream_(vlog_stream) { + vlog_stream_(vlog_stream), + include_debug_info_(include_debug_info) { CARBON_CHECK(!sem_ir.has_errors()) << "Generating LLVM IR from invalid SemIR::File is unsupported."; + BuildCompileUnit(module_name); } // TODO: Move this to lower.cpp. @@ -66,6 +70,22 @@ auto FileContext::Run() -> std::unique_ptr { return std::move(llvm_module_); } +auto FileContext::BuildCompileUnit(llvm::StringRef module_name) -> void { + if (!include_debug_info_) + return; + // FIXME: Include directory path in the cu_file. + llvm::DIFile* cu_file = di_builder_.createFile(module_name, ""); + // FIXME: Introduce a new language code for Carbon. C works well for now since + // it's something debuggers will already know/have support for at least. + // Probably have to bump to C++ at some point for virtual functions, + // templates, etc. + di_compile_unit_ = di_builder_.createCompileUnit( + llvm::dwarf::DW_LANG_C, cu_file, "carbon", false, "", 0, ""); + llvm_module_->addModuleFlag(llvm::Module::Max, "Dwarf Version", 5); + llvm_module_->addModuleFlag(llvm::Module::Warning, "Debug Info Version", + llvm::DEBUG_METADATA_VERSION); +} + auto FileContext::GetGlobal(SemIR::InstId inst_id) -> llvm::Value* { auto inst = sem_ir().insts().Get(inst_id); diff --git a/toolchain/lower/file_context.h b/toolchain/lower/file_context.h index 62e37543908b7..4b17c6c5bd442 100644 --- a/toolchain/lower/file_context.h +++ b/toolchain/lower/file_context.h @@ -6,6 +6,7 @@ #define CARBON_TOOLCHAIN_LOWER_FILE_CONTEXT_H_ #include "llvm/IR/Constants.h" +#include "llvm/IR/DIBuilder.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "toolchain/sem_ir/file.h" @@ -16,7 +17,7 @@ namespace Carbon::Lower { // Context and shared functionality for lowering handlers. class FileContext { public: - explicit FileContext(llvm::LLVMContext& llvm_context, + explicit FileContext(llvm::LLVMContext& llvm_context, bool include_debug_info, llvm::StringRef module_name, const SemIR::File& sem_ir, const SemIR::InstNamer* inst_namer, llvm::raw_ostream* vlog_stream); @@ -25,6 +26,9 @@ class FileContext { // the main execution loop. auto Run() -> std::unique_ptr; + // Create the DICompileUnit metadata for this compilation. + auto BuildCompileUnit(llvm::StringRef module_name) -> void; + // Gets a callable's function. Returns nullptr for a builtin. auto GetFunction(SemIR::FunctionId function_id) -> llvm::Function* { return functions_[function_id.index]; @@ -76,6 +80,8 @@ class FileContext { // State for building the LLVM IR. llvm::LLVMContext* llvm_context_; std::unique_ptr llvm_module_; + llvm::DIBuilder di_builder_; + llvm::DICompileUnit *di_compile_unit_; // The input SemIR. const SemIR::File* const sem_ir_; @@ -101,6 +107,9 @@ class FileContext { // Maps constants to their lowered values. // We resize this directly to the (often large) correct size. llvm::SmallVector constants_; + + // Specify whether to include debug info metadata in the generated LLVM IR. + bool include_debug_info_; }; } // namespace Carbon::Lower diff --git a/toolchain/lower/handle.cpp b/toolchain/lower/handle.cpp index 656bec92d891d..f24cb6dcfcbb0 100644 --- a/toolchain/lower/handle.cpp +++ b/toolchain/lower/handle.cpp @@ -7,6 +7,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constants.h" +#include "llvm/IR/IRBuilder.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" #include "llvm/Support/Casting.h" diff --git a/toolchain/lower/lower.cpp b/toolchain/lower/lower.cpp index 82d06216a237f..22c65b857a732 100644 --- a/toolchain/lower/lower.cpp +++ b/toolchain/lower/lower.cpp @@ -8,12 +8,13 @@ namespace Carbon::Lower { -auto LowerToLLVM(llvm::LLVMContext& llvm_context, llvm::StringRef module_name, - const SemIR::File& sem_ir, const SemIR::InstNamer* inst_namer, +auto LowerToLLVM(llvm::LLVMContext& llvm_context, bool include_debug_info, + llvm::StringRef module_name, const SemIR::File& sem_ir, + const SemIR::InstNamer* inst_namer, llvm::raw_ostream* vlog_stream) -> std::unique_ptr { - FileContext context(llvm_context, module_name, sem_ir, inst_namer, - vlog_stream); + FileContext context(llvm_context, include_debug_info, module_name, sem_ir, + inst_namer, vlog_stream); return context.Run(); } diff --git a/toolchain/lower/lower.h b/toolchain/lower/lower.h index 66ec79d80de7c..36ac71a059166 100644 --- a/toolchain/lower/lower.h +++ b/toolchain/lower/lower.h @@ -13,8 +13,9 @@ namespace Carbon::Lower { // Lowers SemIR to LLVM IR. -auto LowerToLLVM(llvm::LLVMContext& llvm_context, llvm::StringRef module_name, - const SemIR::File& sem_ir, const SemIR::InstNamer* inst_namer, +auto LowerToLLVM(llvm::LLVMContext& llvm_context, bool include_debug_info, + llvm::StringRef module_name, const SemIR::File& sem_ir, + const SemIR::InstNamer* inst_namer, llvm::raw_ostream* vlog_stream) -> std::unique_ptr; diff --git a/toolchain/lower/testdata/alias/local.carbon b/toolchain/lower/testdata/alias/local.carbon index 24f6f83789768..676d8f210ccdf 100644 --- a/toolchain/lower/testdata/alias/local.carbon +++ b/toolchain/lower/testdata/alias/local.carbon @@ -24,3 +24,11 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc14 = load i32, ptr %a.var, align 4 // CHECK:STDOUT: ret i32 %.loc14 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "local.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/array/array_in_place.carbon b/toolchain/lower/testdata/array/array_in_place.carbon index 0fa4a80255a09..d0d2a51c53d47 100644 --- a/toolchain/lower/testdata/array/array_in_place.carbon +++ b/toolchain/lower/testdata/array/array_in_place.carbon @@ -28,3 +28,11 @@ fn G() { // CHECK:STDOUT: call void @F(ptr %.loc14_42.5.array.index) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "array_in_place.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/array/assign_return_value.carbon b/toolchain/lower/testdata/array/assign_return_value.carbon index 9a21a1bf06647..623fa653c8baf 100644 --- a/toolchain/lower/testdata/array/assign_return_value.carbon +++ b/toolchain/lower/testdata/array/assign_return_value.carbon @@ -47,3 +47,11 @@ fn Run() { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "assign_return_value.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/array/base.carbon b/toolchain/lower/testdata/array/base.carbon index eb5174c329ad7..496ece67d6995 100644 --- a/toolchain/lower/testdata/array/base.carbon +++ b/toolchain/lower/testdata/array/base.carbon @@ -68,3 +68,11 @@ fn Run() { // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "base.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/array/function_param.carbon b/toolchain/lower/testdata/array/function_param.carbon index 1759f8df48686..6657458de7900 100644 --- a/toolchain/lower/testdata/array/function_param.carbon +++ b/toolchain/lower/testdata/array/function_param.carbon @@ -43,3 +43,11 @@ fn G() -> i32 { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "function_param.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/basics/empty.carbon b/toolchain/lower/testdata/basics/empty.carbon index ef5076eab179c..7ed97955eb360 100644 --- a/toolchain/lower/testdata/basics/empty.carbon +++ b/toolchain/lower/testdata/basics/empty.carbon @@ -10,3 +10,11 @@ // CHECK:STDOUT: ; ModuleID = 'empty.carbon' // CHECK:STDOUT: source_filename = "empty.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "empty.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/basics/false_true.carbon b/toolchain/lower/testdata/basics/false_true.carbon index 650d65e4fb3dc..c48a68f1c3f0f 100644 --- a/toolchain/lower/testdata/basics/false_true.carbon +++ b/toolchain/lower/testdata/basics/false_true.carbon @@ -28,3 +28,11 @@ fn T() -> bool { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 true // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "false_true.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/basics/int_types.carbon b/toolchain/lower/testdata/basics/int_types.carbon index adeb6e701d265..920e25b664242 100644 --- a/toolchain/lower/testdata/basics/int_types.carbon +++ b/toolchain/lower/testdata/basics/int_types.carbon @@ -35,3 +35,11 @@ fn F_u65536(a: u65536) -> u65536 { return a; } // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i65536 %a // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "int_types.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/basics/numeric_literals.carbon b/toolchain/lower/testdata/basics/numeric_literals.carbon index d6dbe772fd982..0b3e93c6fd13e 100644 --- a/toolchain/lower/testdata/basics/numeric_literals.carbon +++ b/toolchain/lower/testdata/basics/numeric_literals.carbon @@ -59,3 +59,11 @@ fn F() { // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "numeric_literals.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/basics/type_values.carbon b/toolchain/lower/testdata/basics/type_values.carbon index 0c3eb0c00c5e9..658a026eb62e7 100644 --- a/toolchain/lower/testdata/basics/type_values.carbon +++ b/toolchain/lower/testdata/basics/type_values.carbon @@ -42,3 +42,11 @@ fn F64() -> type { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret %type zeroinitializer // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "type_values.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/basics/zero.carbon b/toolchain/lower/testdata/basics/zero.carbon index ced60aa37b4d6..54df83c260b32 100644 --- a/toolchain/lower/testdata/basics/zero.carbon +++ b/toolchain/lower/testdata/basics/zero.carbon @@ -19,3 +19,11 @@ fn Main() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "zero.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/builtins/float.carbon b/toolchain/lower/testdata/builtins/float.carbon index ef3c4f7c493c3..6e2648d08fb97 100644 --- a/toolchain/lower/testdata/builtins/float.carbon +++ b/toolchain/lower/testdata/builtins/float.carbon @@ -109,3 +109,11 @@ fn TestGreaterEq(a: f64, b: f64) -> bool { return GreaterEq(a, b); } // CHECK:STDOUT: %float.greater_eq = fcmp oge double %a, %b // CHECK:STDOUT: ret i1 %float.greater_eq // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "float.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/builtins/int.carbon b/toolchain/lower/testdata/builtins/int.carbon index 2ac1dbf323dcb..cdd55a98fb301 100644 --- a/toolchain/lower/testdata/builtins/int.carbon +++ b/toolchain/lower/testdata/builtins/int.carbon @@ -172,3 +172,11 @@ fn TestGreaterEq(a: i32, b: i32) -> bool { return GreaterEq(a, b); } // CHECK:STDOUT: %int.greater_eq = icmp sge i32 %a, %b // CHECK:STDOUT: ret i1 %int.greater_eq // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "int.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon b/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon index fa5065c0cbd5e..0a40108b3728d 100644 --- a/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon +++ b/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon @@ -28,3 +28,11 @@ fn TestAddMethod(a: i32, b: i32) -> i32 { return a.(AddMethod)(b); } // CHECK:STDOUT: %int.sadd = add i32 %a, %b // CHECK:STDOUT: ret i32 %int.sadd // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "method_vs_nonmethod.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/builtins/overloaded_operator.carbon b/toolchain/lower/testdata/builtins/overloaded_operator.carbon index f732a993c3107..8b63b320e586d 100644 --- a/toolchain/lower/testdata/builtins/overloaded_operator.carbon +++ b/toolchain/lower/testdata/builtins/overloaded_operator.carbon @@ -30,3 +30,11 @@ fn AddThreeIntegers(a: i32, b: i32, c: i32) -> i32 { // CHECK:STDOUT: %int.sadd.loc18_16 = add i32 %.loc18_12.4, %c // CHECK:STDOUT: ret i32 %int.sadd.loc18_16 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "overloaded_operator.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/builtins/print.carbon b/toolchain/lower/testdata/builtins/print.carbon index d22897904bb0d..c15164baa4f61 100644 --- a/toolchain/lower/testdata/builtins/print.carbon +++ b/toolchain/lower/testdata/builtins/print.carbon @@ -24,3 +24,11 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare i32 @printf(ptr, ...) +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "print.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/builtins/types.carbon b/toolchain/lower/testdata/builtins/types.carbon index 81b08095a348a..af255b27dfeb0 100644 --- a/toolchain/lower/testdata/builtins/types.carbon +++ b/toolchain/lower/testdata/builtins/types.carbon @@ -31,3 +31,11 @@ fn F() { // CHECK:STDOUT: store i1 false, ptr %b.var, align 1 // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "types.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/builtins/uint.carbon b/toolchain/lower/testdata/builtins/uint.carbon index d57b6367873de..00c2a7d61ca05 100644 --- a/toolchain/lower/testdata/builtins/uint.carbon +++ b/toolchain/lower/testdata/builtins/uint.carbon @@ -172,3 +172,11 @@ fn TestGreaterEq(a: u64, b: u64) -> bool { return GreaterEq(a, b); } // CHECK:STDOUT: %int.greater_eq = icmp uge i64 %a, %b // CHECK:STDOUT: ret i1 %int.greater_eq // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "uint.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/class/adapt.carbon b/toolchain/lower/testdata/class/adapt.carbon index 2bec22d6c19be..4e1cb5b0ef99b 100644 --- a/toolchain/lower/testdata/class/adapt.carbon +++ b/toolchain/lower/testdata/class/adapt.carbon @@ -89,6 +89,14 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "adapt_class.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: ; ModuleID = 'adapt_int.carbon' // CHECK:STDOUT: source_filename = "adapt_int.carbon" // CHECK:STDOUT: @@ -96,3 +104,11 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 %a // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "adapt_int.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/class/base.carbon b/toolchain/lower/testdata/class/base.carbon index 0eebdcb503123..f9760f8f9b0cc 100644 --- a/toolchain/lower/testdata/class/base.carbon +++ b/toolchain/lower/testdata/class/base.carbon @@ -68,3 +68,11 @@ fn Convert(p: Derived*) -> Base* { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "base.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/class/basic.carbon b/toolchain/lower/testdata/class/basic.carbon index be0d3d12df96c..9f0c70739a08b 100644 --- a/toolchain/lower/testdata/class/basic.carbon +++ b/toolchain/lower/testdata/class/basic.carbon @@ -32,3 +32,11 @@ fn Run() { // CHECK:STDOUT: call void @F(ptr %d.var, ptr %c.var) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "basic.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/class/field.carbon b/toolchain/lower/testdata/class/field.carbon index 9ff92362aa3cb..67c9236e44015 100644 --- a/toolchain/lower/testdata/class/field.carbon +++ b/toolchain/lower/testdata/class/field.carbon @@ -46,3 +46,11 @@ fn Run() -> i32 { // CHECK:STDOUT: %F.call = call i32 @F(ptr %c.var) // CHECK:STDOUT: ret i32 %F.call // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "field.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/class/method.carbon b/toolchain/lower/testdata/class/method.carbon index a52aba42fd323..2e8b661a0e72d 100644 --- a/toolchain/lower/testdata/class/method.carbon +++ b/toolchain/lower/testdata/class/method.carbon @@ -33,3 +33,11 @@ fn F(p: C*) { // CHECK:STDOUT: call void @Set(ptr %p, i32 %Get.call) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "method.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/class/self.carbon b/toolchain/lower/testdata/class/self.carbon index 7b5f3746abd28..517fa4437d486 100644 --- a/toolchain/lower/testdata/class/self.carbon +++ b/toolchain/lower/testdata/class/self.carbon @@ -39,3 +39,11 @@ fn C.Set[addr self: C*]() { // CHECK:STDOUT: store i32 1, ptr %.loc23_10.a, align 4 // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "self.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/class/value_access.carbon b/toolchain/lower/testdata/class/value_access.carbon index 83fce738bc555..7959178c5b588 100644 --- a/toolchain/lower/testdata/class/value_access.carbon +++ b/toolchain/lower/testdata/class/value_access.carbon @@ -42,3 +42,11 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: %.loc19_13.tuple.index.load = load i32, ptr %.loc19_13.tuple.index, align 4 // CHECK:STDOUT: ret i32 %.loc19_13.tuple.index.load // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "value_access.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/empty_struct.carbon b/toolchain/lower/testdata/function/call/empty_struct.carbon index bc3e91a1000ec..dce746569bbc0 100644 --- a/toolchain/lower/testdata/function/call/empty_struct.carbon +++ b/toolchain/lower/testdata/function/call/empty_struct.carbon @@ -30,3 +30,11 @@ fn Main() { // CHECK:STDOUT: call void @Echo() // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "empty_struct.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/empty_tuple.carbon b/toolchain/lower/testdata/function/call/empty_tuple.carbon index 33f4ed2b16d31..bf7a13e0bc885 100644 --- a/toolchain/lower/testdata/function/call/empty_tuple.carbon +++ b/toolchain/lower/testdata/function/call/empty_tuple.carbon @@ -30,3 +30,11 @@ fn Main() { // CHECK:STDOUT: call void @Echo() // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "empty_tuple.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/i32.carbon b/toolchain/lower/testdata/function/call/i32.carbon index bb89e3befe919..8e42676d432ed 100644 --- a/toolchain/lower/testdata/function/call/i32.carbon +++ b/toolchain/lower/testdata/function/call/i32.carbon @@ -31,3 +31,11 @@ fn Main() { // CHECK:STDOUT: store i32 %Echo.call, ptr %b.var, align 4 // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "i32.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon b/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon index ed9267995c621..66184ec2e74d2 100644 --- a/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon +++ b/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon @@ -38,3 +38,11 @@ fn Main() { // CHECK:STDOUT: call void @Bar() // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "implicit_empty_tuple_as_arg.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/params_one.carbon b/toolchain/lower/testdata/function/call/params_one.carbon index d3d2b266676b2..2bb6decd257a9 100644 --- a/toolchain/lower/testdata/function/call/params_one.carbon +++ b/toolchain/lower/testdata/function/call/params_one.carbon @@ -27,3 +27,11 @@ fn Main() { // CHECK:STDOUT: call void @Foo(i32 1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "params_one.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/params_one_comma.carbon b/toolchain/lower/testdata/function/call/params_one_comma.carbon index 4aa6e9625f882..0a049c045f6cd 100644 --- a/toolchain/lower/testdata/function/call/params_one_comma.carbon +++ b/toolchain/lower/testdata/function/call/params_one_comma.carbon @@ -29,3 +29,11 @@ fn Main() { // CHECK:STDOUT: call void @Foo(i32 1) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "params_one_comma.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/params_two.carbon b/toolchain/lower/testdata/function/call/params_two.carbon index 65b46932c1eed..c35ac87c2b602 100644 --- a/toolchain/lower/testdata/function/call/params_two.carbon +++ b/toolchain/lower/testdata/function/call/params_two.carbon @@ -27,3 +27,11 @@ fn Main() { // CHECK:STDOUT: call void @Foo(i32 1, i32 2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "params_two.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/params_two_comma.carbon b/toolchain/lower/testdata/function/call/params_two_comma.carbon index 1661fa6e2dbf1..376f1f0a7fede 100644 --- a/toolchain/lower/testdata/function/call/params_two_comma.carbon +++ b/toolchain/lower/testdata/function/call/params_two_comma.carbon @@ -29,3 +29,11 @@ fn Main() { // CHECK:STDOUT: call void @Foo(i32 1, i32 2) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "params_two_comma.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/params_zero.carbon b/toolchain/lower/testdata/function/call/params_zero.carbon index 3acb0f8c4d6d8..2fc142b714de9 100644 --- a/toolchain/lower/testdata/function/call/params_zero.carbon +++ b/toolchain/lower/testdata/function/call/params_zero.carbon @@ -27,3 +27,11 @@ fn Main() { // CHECK:STDOUT: call void @Foo() // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "params_zero.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/return_implicit.carbon b/toolchain/lower/testdata/function/call/return_implicit.carbon index 0ba263d46f72a..e8423063911a1 100644 --- a/toolchain/lower/testdata/function/call/return_implicit.carbon +++ b/toolchain/lower/testdata/function/call/return_implicit.carbon @@ -30,3 +30,11 @@ fn Main() { // CHECK:STDOUT: call void @MakeImplicitEmptyTuple() // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "return_implicit.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/struct_param.carbon b/toolchain/lower/testdata/function/call/struct_param.carbon index 9315be9fa056b..4b280c7e0f94b 100644 --- a/toolchain/lower/testdata/function/call/struct_param.carbon +++ b/toolchain/lower/testdata/function/call/struct_param.carbon @@ -29,3 +29,11 @@ fn Main() { // CHECK:STDOUT: call void @F({ i32 } { i32 1 }, ptr @struct.3.loc14_4.3) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "struct_param.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/tuple_param.carbon b/toolchain/lower/testdata/function/call/tuple_param.carbon index 1fb50b91186c5..56ece8cb06afb 100644 --- a/toolchain/lower/testdata/function/call/tuple_param.carbon +++ b/toolchain/lower/testdata/function/call/tuple_param.carbon @@ -29,3 +29,11 @@ fn Main() { // CHECK:STDOUT: call void @F({ i32 } { i32 1 }, ptr @tuple.3.loc14_4.3) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "tuple_param.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon b/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon index b8b928e1b7252..6880ea6f7d918 100644 --- a/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon +++ b/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon @@ -46,3 +46,11 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder i32 1, { 3, 0, 1, 2 } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "tuple_param_with_return_slot.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/call/var_param.carbon b/toolchain/lower/testdata/function/call/var_param.carbon index 941dcbbc99a3e..a126952095056 100644 --- a/toolchain/lower/testdata/function/call/var_param.carbon +++ b/toolchain/lower/testdata/function/call/var_param.carbon @@ -31,3 +31,11 @@ fn Main() { // CHECK:STDOUT: call void @DoNothing(i32 %.loc15) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "var_param.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/declaration/simple.carbon b/toolchain/lower/testdata/function/declaration/simple.carbon index 50d8f01dbd7ba..79d5f1d6828f5 100644 --- a/toolchain/lower/testdata/function/declaration/simple.carbon +++ b/toolchain/lower/testdata/function/declaration/simple.carbon @@ -22,3 +22,11 @@ fn G(n: i32) { F(n); } // CHECK:STDOUT: call void @F(i32 %n) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "simple.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/definition/empty_struct.carbon b/toolchain/lower/testdata/function/definition/empty_struct.carbon index 211dbf21a0e65..41f679f9b8fcb 100644 --- a/toolchain/lower/testdata/function/definition/empty_struct.carbon +++ b/toolchain/lower/testdata/function/definition/empty_struct.carbon @@ -18,3 +18,11 @@ fn Echo(a: {}) { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "empty_struct.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/definition/params_one.carbon b/toolchain/lower/testdata/function/definition/params_one.carbon index 7e181e7eb59f6..639e7406eb3f9 100644 --- a/toolchain/lower/testdata/function/definition/params_one.carbon +++ b/toolchain/lower/testdata/function/definition/params_one.carbon @@ -17,3 +17,11 @@ fn Foo(a: i32) {} // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "params_one.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/definition/params_two.carbon b/toolchain/lower/testdata/function/definition/params_two.carbon index 06952a0903317..c72804ea0fe74 100644 --- a/toolchain/lower/testdata/function/definition/params_two.carbon +++ b/toolchain/lower/testdata/function/definition/params_two.carbon @@ -17,3 +17,11 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "params_two.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/definition/params_zero.carbon b/toolchain/lower/testdata/function/definition/params_zero.carbon index 287fa72095339..9f442a22625a0 100644 --- a/toolchain/lower/testdata/function/definition/params_zero.carbon +++ b/toolchain/lower/testdata/function/definition/params_zero.carbon @@ -17,3 +17,11 @@ fn Foo() {} // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "params_zero.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/function/generic/type_param.carbon b/toolchain/lower/testdata/function/generic/type_param.carbon index d827a3eb7a34c..9605ba62143e9 100644 --- a/toolchain/lower/testdata/function/generic/type_param.carbon +++ b/toolchain/lower/testdata/function/generic/type_param.carbon @@ -15,3 +15,11 @@ fn F(T:! type) { // CHECK:STDOUT: ; ModuleID = 'type_param.carbon' // CHECK:STDOUT: source_filename = "type_param.carbon" +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "type_param.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/if/else.carbon b/toolchain/lower/testdata/if/else.carbon index 4903751e373cc..6da85106798b6 100644 --- a/toolchain/lower/testdata/if/else.carbon +++ b/toolchain/lower/testdata/if/else.carbon @@ -55,3 +55,11 @@ fn If(b: bool) { // CHECK:STDOUT: call void @H() // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "else.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/if/no_else.carbon b/toolchain/lower/testdata/if/no_else.carbon index 80759aa4aabcc..b08072dc5b4ba 100644 --- a/toolchain/lower/testdata/if/no_else.carbon +++ b/toolchain/lower/testdata/if/no_else.carbon @@ -43,3 +43,11 @@ fn If(b: bool) { // CHECK:STDOUT: call void @G() // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "no_else.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/if_expr/basic.carbon b/toolchain/lower/testdata/if_expr/basic.carbon index 360828e847464..7e87092aa01a0 100644 --- a/toolchain/lower/testdata/if_expr/basic.carbon +++ b/toolchain/lower/testdata/if_expr/basic.carbon @@ -44,3 +44,11 @@ fn Select(b: bool) -> i32 { // CHECK:STDOUT: %0 = phi i32 [ %F.call, %if.expr.then ], [ %G.call, %if.expr.else ] // CHECK:STDOUT: ret i32 %0 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "basic.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/if_expr/empty_block.carbon b/toolchain/lower/testdata/if_expr/empty_block.carbon index 28addd0bd21c4..31fc858f89cd2 100644 --- a/toolchain/lower/testdata/if_expr/empty_block.carbon +++ b/toolchain/lower/testdata/if_expr/empty_block.carbon @@ -49,3 +49,11 @@ fn Select(b: bool, c: bool, d: bool) -> i32 { // CHECK:STDOUT: %2 = phi i32 [ %0, %if.expr.result.loc12_20 ], [ %1, %if.expr.result.loc12_44 ] // CHECK:STDOUT: ret i32 %2 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "empty_block.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/impl/assoc_fn_alias.carbon b/toolchain/lower/testdata/impl/assoc_fn_alias.carbon index cc807b9da153b..baba57f64ec0f 100644 --- a/toolchain/lower/testdata/impl/assoc_fn_alias.carbon +++ b/toolchain/lower/testdata/impl/assoc_fn_alias.carbon @@ -42,3 +42,11 @@ fn Call(a: A) -> i32 { // CHECK:STDOUT: %F.call = call i32 @F(ptr %a) // CHECK:STDOUT: ret i32 %F.call // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "assoc_fn_alias.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/impl/extend_impl.carbon b/toolchain/lower/testdata/impl/extend_impl.carbon index 7bf5d812987b3..4edf9757ee4f8 100644 --- a/toolchain/lower/testdata/impl/extend_impl.carbon +++ b/toolchain/lower/testdata/impl/extend_impl.carbon @@ -47,3 +47,11 @@ fn InstanceAccess(a: A) -> i32 { // CHECK:STDOUT: %F.call = call i32 @F() // CHECK:STDOUT: ret i32 %F.call // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "extend_impl.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/impl/impl.carbon b/toolchain/lower/testdata/impl/impl.carbon index 0a1d2c72897cb..dbec77ba52175 100644 --- a/toolchain/lower/testdata/impl/impl.carbon +++ b/toolchain/lower/testdata/impl/impl.carbon @@ -41,3 +41,11 @@ fn Call(a: A) -> i32 { // CHECK:STDOUT: %F.call = call i32 @F(ptr %a) // CHECK:STDOUT: ret i32 %F.call // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "impl.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/impl/instance_method.carbon b/toolchain/lower/testdata/impl/instance_method.carbon index fe5edb73657cf..de905f9f283ac 100644 --- a/toolchain/lower/testdata/impl/instance_method.carbon +++ b/toolchain/lower/testdata/impl/instance_method.carbon @@ -39,3 +39,11 @@ fn Call(a: A*) -> A* { // CHECK:STDOUT: %Get.call = call ptr @Get(ptr %a) // CHECK:STDOUT: ret ptr %Get.call // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "instance_method.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/index/array_element_access.carbon b/toolchain/lower/testdata/index/array_element_access.carbon index 24952276f495d..689b69e30ea57 100644 --- a/toolchain/lower/testdata/index/array_element_access.carbon +++ b/toolchain/lower/testdata/index/array_element_access.carbon @@ -76,3 +76,11 @@ fn Run() { // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "array_element_access.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/index/tuple_element_access.carbon b/toolchain/lower/testdata/index/tuple_element_access.carbon index f16271fd34e7a..7ed405f9e2b4f 100644 --- a/toolchain/lower/testdata/index/tuple_element_access.carbon +++ b/toolchain/lower/testdata/index/tuple_element_access.carbon @@ -42,3 +42,11 @@ fn Run() -> i32 { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "tuple_element_access.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/index/tuple_return_value_access.carbon b/toolchain/lower/testdata/index/tuple_return_value_access.carbon index a139bacc14cfd..c5db914086c8c 100644 --- a/toolchain/lower/testdata/index/tuple_return_value_access.carbon +++ b/toolchain/lower/testdata/index/tuple_return_value_access.carbon @@ -42,3 +42,11 @@ fn Run() { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "tuple_return_value_access.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/interface/assoc.carbon b/toolchain/lower/testdata/interface/assoc.carbon index 9c228855224d4..9b88f9d988bc9 100644 --- a/toolchain/lower/testdata/interface/assoc.carbon +++ b/toolchain/lower/testdata/interface/assoc.carbon @@ -21,3 +21,11 @@ fn F() { I.Assoc; } // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "assoc.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/interface/basic.carbon b/toolchain/lower/testdata/interface/basic.carbon index dd624d6bba277..3946ba7af5f6f 100644 --- a/toolchain/lower/testdata/interface/basic.carbon +++ b/toolchain/lower/testdata/interface/basic.carbon @@ -33,3 +33,11 @@ fn G(T: J) {} // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "basic.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/let/local.carbon b/toolchain/lower/testdata/let/local.carbon index edf5eb251d28c..b9a96aae29284 100644 --- a/toolchain/lower/testdata/let/local.carbon +++ b/toolchain/lower/testdata/let/local.carbon @@ -21,3 +21,11 @@ fn Run() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 1 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "local.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/let/tuple.carbon b/toolchain/lower/testdata/let/tuple.carbon index 7215f3f22db5c..8a43ce5716c82 100644 --- a/toolchain/lower/testdata/let/tuple.carbon +++ b/toolchain/lower/testdata/let/tuple.carbon @@ -73,3 +73,11 @@ fn F() -> i32 { // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "tuple.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/namespace/function.carbon b/toolchain/lower/testdata/namespace/function.carbon index 275c8c689eadd..ded4d4850294c 100644 --- a/toolchain/lower/testdata/namespace/function.carbon +++ b/toolchain/lower/testdata/namespace/function.carbon @@ -39,3 +39,11 @@ fn Bar() { // CHECK:STDOUT: call void @Baz.1() // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "function.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/namespace/nested.carbon b/toolchain/lower/testdata/namespace/nested.carbon index 072d7d36aa688..5ab9373322440 100644 --- a/toolchain/lower/testdata/namespace/nested.carbon +++ b/toolchain/lower/testdata/namespace/nested.carbon @@ -31,3 +31,11 @@ fn Foo.Bar.Baz() { // CHECK:STDOUT: call void @Wiz() // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "nested.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/operators/and.carbon b/toolchain/lower/testdata/operators/and.carbon index babe6a123bb17..3a3478e88f524 100644 --- a/toolchain/lower/testdata/operators/and.carbon +++ b/toolchain/lower/testdata/operators/and.carbon @@ -41,3 +41,11 @@ fn And() -> bool { // CHECK:STDOUT: %0 = phi i1 [ false, %entry ], [ %G.call, %and.rhs ] // CHECK:STDOUT: ret i1 %0 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "and.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/operators/and_empty_block.carbon b/toolchain/lower/testdata/operators/and_empty_block.carbon index 6393f4c750b00..937798de18ef8 100644 --- a/toolchain/lower/testdata/operators/and_empty_block.carbon +++ b/toolchain/lower/testdata/operators/and_empty_block.carbon @@ -28,3 +28,11 @@ fn And(b: bool, c: bool) -> bool { // CHECK:STDOUT: %0 = phi i1 [ false, %entry ], [ %c, %and.rhs ] // CHECK:STDOUT: ret i1 %0 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "and_empty_block.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/operators/assignment.carbon b/toolchain/lower/testdata/operators/assignment.carbon index 74fbe01f5af46..88a4a2c321171 100644 --- a/toolchain/lower/testdata/operators/assignment.carbon +++ b/toolchain/lower/testdata/operators/assignment.carbon @@ -36,3 +36,11 @@ fn Main() { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "assignment.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/operators/not.carbon b/toolchain/lower/testdata/operators/not.carbon index bbd19c3c6b4ec..179d7922c880b 100644 --- a/toolchain/lower/testdata/operators/not.carbon +++ b/toolchain/lower/testdata/operators/not.carbon @@ -20,3 +20,11 @@ fn Not(b: bool) -> bool { // CHECK:STDOUT: %.loc12 = xor i1 %b, true // CHECK:STDOUT: ret i1 %.loc12 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "not.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/operators/or.carbon b/toolchain/lower/testdata/operators/or.carbon index 0d28c26cc60fe..6f996bac39545 100644 --- a/toolchain/lower/testdata/operators/or.carbon +++ b/toolchain/lower/testdata/operators/or.carbon @@ -42,3 +42,11 @@ fn Or() -> bool { // CHECK:STDOUT: %0 = phi i1 [ true, %entry ], [ %G.call, %or.rhs ] // CHECK:STDOUT: ret i1 %0 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "or.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/operators/or_empty_block.carbon b/toolchain/lower/testdata/operators/or_empty_block.carbon index cc9ec1bda6ba2..b888eacdacb6f 100644 --- a/toolchain/lower/testdata/operators/or_empty_block.carbon +++ b/toolchain/lower/testdata/operators/or_empty_block.carbon @@ -29,3 +29,11 @@ fn Or(b: bool, c: bool) -> bool { // CHECK:STDOUT: %0 = phi i1 [ true, %entry ], [ %c, %or.rhs ] // CHECK:STDOUT: ret i1 %0 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "or_empty_block.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/operators/overloaded.carbon b/toolchain/lower/testdata/operators/overloaded.carbon index 835b4d599a12a..bf103477fbb44 100644 --- a/toolchain/lower/testdata/operators/overloaded.carbon +++ b/toolchain/lower/testdata/operators/overloaded.carbon @@ -90,3 +90,11 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder i1 true, { 2, 0, 1, 3, 4 } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "overloaded.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/packages/cross_package_call.carbon b/toolchain/lower/testdata/packages/cross_package_call.carbon index 6c2b4e76142e8..e8efc25d18c58 100644 --- a/toolchain/lower/testdata/packages/cross_package_call.carbon +++ b/toolchain/lower/testdata/packages/cross_package_call.carbon @@ -27,6 +27,14 @@ fn G() { A.F(); } // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "a.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: ; ModuleID = 'b.carbon' // CHECK:STDOUT: source_filename = "b.carbon" // CHECK:STDOUT: @@ -37,3 +45,11 @@ fn G() { A.F(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: declare void @F() +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "b.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/pointer/address_of_field.carbon b/toolchain/lower/testdata/pointer/address_of_field.carbon index 9db04baf6e6f5..45542687c8919 100644 --- a/toolchain/lower/testdata/pointer/address_of_field.carbon +++ b/toolchain/lower/testdata/pointer/address_of_field.carbon @@ -37,3 +37,11 @@ fn F() { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "address_of_field.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/pointer/address_of_unused.carbon b/toolchain/lower/testdata/pointer/address_of_unused.carbon index 9bd6024c6bf04..0502b5a6df7ff 100644 --- a/toolchain/lower/testdata/pointer/address_of_unused.carbon +++ b/toolchain/lower/testdata/pointer/address_of_unused.carbon @@ -22,3 +22,11 @@ fn F() { // CHECK:STDOUT: store i32 0, ptr %n.var, align 4 // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "address_of_unused.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/pointer/basic.carbon b/toolchain/lower/testdata/pointer/basic.carbon index 8d94914bdd408..192aeae8f1249 100644 --- a/toolchain/lower/testdata/pointer/basic.carbon +++ b/toolchain/lower/testdata/pointer/basic.carbon @@ -33,3 +33,11 @@ fn F() -> i32 { // CHECK:STDOUT: %G.call = call i32 @G(ptr %n.var) // CHECK:STDOUT: ret i32 %G.call // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "basic.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon b/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon index a9b2ed1f4aab6..75f081080d8c3 100644 --- a/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon +++ b/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon @@ -32,3 +32,11 @@ fn F(p: i32**) -> i32 { // CHECK:STDOUT: %.loc15_10.2 = load i32, ptr %.loc15_11.2, align 4 // CHECK:STDOUT: ret i32 %.loc15_10.2 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "pointer_to_pointer.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/return/code_after_return.carbon b/toolchain/lower/testdata/return/code_after_return.carbon index 5ee26d112ee71..5d72cc609322e 100644 --- a/toolchain/lower/testdata/return/code_after_return.carbon +++ b/toolchain/lower/testdata/return/code_after_return.carbon @@ -27,3 +27,11 @@ fn Main() { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "code_after_return.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/return/no_value.carbon b/toolchain/lower/testdata/return/no_value.carbon index 3be486fb12410..f4fa80acfce3b 100644 --- a/toolchain/lower/testdata/return/no_value.carbon +++ b/toolchain/lower/testdata/return/no_value.carbon @@ -19,3 +19,11 @@ fn Main() { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "no_value.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/return/return_var.carbon b/toolchain/lower/testdata/return/return_var.carbon index a41c83f41d063..a01fb8cceaf92 100644 --- a/toolchain/lower/testdata/return/return_var.carbon +++ b/toolchain/lower/testdata/return/return_var.carbon @@ -29,3 +29,11 @@ fn Make() -> C { // CHECK:STDOUT: store ptr %return, ptr %.loc18_30.4.next, align 8 // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "return_var.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/return/return_var_byval.carbon b/toolchain/lower/testdata/return/return_var_byval.carbon index 0214d853728a2..36d2786f28a06 100644 --- a/toolchain/lower/testdata/return/return_var_byval.carbon +++ b/toolchain/lower/testdata/return/return_var_byval.carbon @@ -23,3 +23,11 @@ fn Main() -> i32 { // CHECK:STDOUT: %.loc12_16 = load i32, ptr %x.var, align 4 // CHECK:STDOUT: ret i32 %.loc12_16 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "return_var_byval.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/return/value.carbon b/toolchain/lower/testdata/return/value.carbon index 05b9c7cdebef7..b52d764cbfb42 100644 --- a/toolchain/lower/testdata/return/value.carbon +++ b/toolchain/lower/testdata/return/value.carbon @@ -19,3 +19,11 @@ fn Main() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "value.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/return/var.carbon b/toolchain/lower/testdata/return/var.carbon index 86f2e560904d7..f9ccee855de68 100644 --- a/toolchain/lower/testdata/return/var.carbon +++ b/toolchain/lower/testdata/return/var.carbon @@ -23,3 +23,11 @@ fn Main() -> i32 { // CHECK:STDOUT: %.loc13 = load i32, ptr %x.var, align 4 // CHECK:STDOUT: ret i32 %.loc13 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "var.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/struct/empty.carbon b/toolchain/lower/testdata/struct/empty.carbon index f7364fd7fead4..45057b320d017 100644 --- a/toolchain/lower/testdata/struct/empty.carbon +++ b/toolchain/lower/testdata/struct/empty.carbon @@ -23,3 +23,11 @@ fn Run() -> i32 { // CHECK:STDOUT: %y.var = alloca {}, align 8 // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "empty.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/struct/member_access.carbon b/toolchain/lower/testdata/struct/member_access.carbon index f01d2ad3fba09..50f08517ad6df 100644 --- a/toolchain/lower/testdata/struct/member_access.carbon +++ b/toolchain/lower/testdata/struct/member_access.carbon @@ -40,3 +40,11 @@ fn Run() -> i32 { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "member_access.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/struct/nested_struct.carbon b/toolchain/lower/testdata/struct/nested_struct.carbon index e5b49994a13e4..4283540cdc7ef 100644 --- a/toolchain/lower/testdata/struct/nested_struct.carbon +++ b/toolchain/lower/testdata/struct/nested_struct.carbon @@ -20,3 +20,11 @@ fn Run() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "nested_struct.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon index 94d96d565eb31..ea10ddc165f67 100644 --- a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon @@ -28,3 +28,11 @@ fn G() { // CHECK:STDOUT: call void @F(ptr %.loc14_74.2.b) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "nested_struct_in_place.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/struct/one_entry.carbon b/toolchain/lower/testdata/struct/one_entry.carbon index a3857e8550ad8..14c4ee49eadc2 100644 --- a/toolchain/lower/testdata/struct/one_entry.carbon +++ b/toolchain/lower/testdata/struct/one_entry.carbon @@ -28,3 +28,11 @@ fn Run() -> i32 { // CHECK:STDOUT: store { i32 } %.loc13_22.3.struct.init, ptr %y.var, align 4 // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "one_entry.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/struct/two_entries.carbon b/toolchain/lower/testdata/struct/two_entries.carbon index 0c74c7cf9e58b..c03a5f401687e 100644 --- a/toolchain/lower/testdata/struct/two_entries.carbon +++ b/toolchain/lower/testdata/struct/two_entries.carbon @@ -41,3 +41,11 @@ fn Run() -> i32 { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "two_entries.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/tuple/empty.carbon b/toolchain/lower/testdata/tuple/empty.carbon index 5b7d4801a5ca4..1a8e29fdb64ae 100644 --- a/toolchain/lower/testdata/tuple/empty.carbon +++ b/toolchain/lower/testdata/tuple/empty.carbon @@ -23,3 +23,11 @@ fn Run() -> i32 { // CHECK:STDOUT: %y.var = alloca {}, align 8 // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "empty.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/tuple/nested_tuple.carbon b/toolchain/lower/testdata/tuple/nested_tuple.carbon index 3a5888e017d93..7a7b503555514 100644 --- a/toolchain/lower/testdata/tuple/nested_tuple.carbon +++ b/toolchain/lower/testdata/tuple/nested_tuple.carbon @@ -20,3 +20,11 @@ fn Run() -> i32 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "nested_tuple.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon index 5dc8fe1fa42fc..6a057fca0e5c9 100644 --- a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon @@ -28,3 +28,11 @@ fn G() { // CHECK:STDOUT: call void @F(ptr %.loc14_56.2.tuple.elem) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "nested_tuple_in_place.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/tuple/one_entry.carbon b/toolchain/lower/testdata/tuple/one_entry.carbon index 83fa542655768..45ed31fef7de9 100644 --- a/toolchain/lower/testdata/tuple/one_entry.carbon +++ b/toolchain/lower/testdata/tuple/one_entry.carbon @@ -31,3 +31,11 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder i32 1, { 0, 2, 1 } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "one_entry.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/tuple/two_entries.carbon b/toolchain/lower/testdata/tuple/two_entries.carbon index 3eb65db7a6bf2..bfa760e648601 100644 --- a/toolchain/lower/testdata/tuple/two_entries.carbon +++ b/toolchain/lower/testdata/tuple/two_entries.carbon @@ -41,3 +41,11 @@ fn Run() -> i32 { // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "two_entries.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/tuple/value_formation.carbon b/toolchain/lower/testdata/tuple/value_formation.carbon index 94138a454f7c1..e25a4f2673d86 100644 --- a/toolchain/lower/testdata/tuple/value_formation.carbon +++ b/toolchain/lower/testdata/tuple/value_formation.carbon @@ -59,3 +59,11 @@ fn F() { // CHECK:STDOUT: call void @G(ptr %tuple.loc16_10) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "value_formation.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/tuple/value_forwarding.carbon b/toolchain/lower/testdata/tuple/value_forwarding.carbon index 15dba88e41719..c6d0570602088 100644 --- a/toolchain/lower/testdata/tuple/value_forwarding.carbon +++ b/toolchain/lower/testdata/tuple/value_forwarding.carbon @@ -29,3 +29,11 @@ fn F(a: (i32, i32, i32), b: (i32, i32, i32)) { // CHECK:STDOUT: call void @G(ptr %tuple) // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "value_forwarding.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/var/local.carbon b/toolchain/lower/testdata/var/local.carbon index 8d34b2b29ed46..d59524161abde 100644 --- a/toolchain/lower/testdata/var/local.carbon +++ b/toolchain/lower/testdata/var/local.carbon @@ -23,3 +23,11 @@ fn Run() -> i32 { // CHECK:STDOUT: %.loc13 = load i32, ptr %x.var, align 4 // CHECK:STDOUT: ret i32 %.loc13 // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "local.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/while/break_continue.carbon b/toolchain/lower/testdata/while/break_continue.carbon index 7dbeca8ef07f2..46075a6532b14 100644 --- a/toolchain/lower/testdata/while/break_continue.carbon +++ b/toolchain/lower/testdata/while/break_continue.carbon @@ -59,3 +59,11 @@ fn While() { // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder label %while.cond, { 1, 2, 0 } // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "break_continue.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/while/preheader.carbon b/toolchain/lower/testdata/while/preheader.carbon index 5e19981371e4e..a2005c848b775 100644 --- a/toolchain/lower/testdata/while/preheader.carbon +++ b/toolchain/lower/testdata/while/preheader.carbon @@ -70,3 +70,11 @@ fn While() { // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder label %while.cond.loc20, { 1, 0 } // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "preheader.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/while/unreachable_end.carbon b/toolchain/lower/testdata/while/unreachable_end.carbon index d4d352efca5c8..a9f2421185f7e 100644 --- a/toolchain/lower/testdata/while/unreachable_end.carbon +++ b/toolchain/lower/testdata/while/unreachable_end.carbon @@ -51,3 +51,11 @@ fn While() { // CHECK:STDOUT: call void @H() // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "unreachable_end.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/lower/testdata/while/while.carbon b/toolchain/lower/testdata/while/while.carbon index 763dea3f773d3..8b88d14cceaf1 100644 --- a/toolchain/lower/testdata/while/while.carbon +++ b/toolchain/lower/testdata/while/while.carbon @@ -50,3 +50,11 @@ fn While() { // CHECK:STDOUT: call void @H() // CHECK:STDOUT: ret void // CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.dbg.cu = !{!0} +// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !1 = !DIFile(filename: "while.carbon", directory: "") +// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} diff --git a/toolchain/testing/file_test.cpp b/toolchain/testing/file_test.cpp index fc2f119a01d96..9d554dd309bdc 100644 --- a/toolchain/testing/file_test.cpp +++ b/toolchain/testing/file_test.cpp @@ -70,6 +70,7 @@ class ToolchainFileTest : public FileTestBase { args.push_back("--dump-sem-ir"); } else if (component_ == "lower") { args.push_back("--dump-llvm-ir"); + args.push_back("--debug-info"); } else { CARBON_FATAL() << "Unexpected test component " << component_ << ": " << test_name(); From 58981cd4967f526444fc0aee6061d7cd19471554 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 19 Aug 2024 10:59:36 -0700 Subject: [PATCH 02/11] left-bind '*' in toolchain/lower/file_context.h Co-authored-by: Carbon Infra Bot --- toolchain/lower/file_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/lower/file_context.h b/toolchain/lower/file_context.h index 4b17c6c5bd442..e3e9f477b63a6 100644 --- a/toolchain/lower/file_context.h +++ b/toolchain/lower/file_context.h @@ -81,7 +81,7 @@ class FileContext { llvm::LLVMContext* llvm_context_; std::unique_ptr llvm_module_; llvm::DIBuilder di_builder_; - llvm::DICompileUnit *di_compile_unit_; + llvm::DICompileUnit* di_compile_unit_; // The input SemIR. const SemIR::File* const sem_ir_; From 391bb7d4a9ca77c303bd5313574b01fbf551a9a9 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 19 Aug 2024 11:04:02 -0700 Subject: [PATCH 03/11] Add missing braces Co-authored-by: Carbon Infra Bot --- toolchain/lower/file_context.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 5f8d1b4908fd1..6701f4b325de0 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -71,8 +71,9 @@ auto FileContext::Run() -> std::unique_ptr { } auto FileContext::BuildCompileUnit(llvm::StringRef module_name) -> void { - if (!include_debug_info_) + if (!include_debug_info_) { return; + } // FIXME: Include directory path in the cu_file. llvm::DIFile* cu_file = di_builder_.createFile(module_name, ""); // FIXME: Introduce a new language code for Carbon. C works well for now since From 613c88870b7bb9b7b548b9d280383b4d66de3eac Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 19 Aug 2024 11:06:37 -0700 Subject: [PATCH 04/11] add argument name comments for clarity Co-authored-by: Jon Ross-Perkins --- toolchain/lower/file_context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 6701f4b325de0..d27418913b697 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -81,7 +81,7 @@ auto FileContext::BuildCompileUnit(llvm::StringRef module_name) -> void { // Probably have to bump to C++ at some point for virtual functions, // templates, etc. di_compile_unit_ = di_builder_.createCompileUnit( - llvm::dwarf::DW_LANG_C, cu_file, "carbon", false, "", 0, ""); + llvm::dwarf::DW_LANG_C, cu_file, "carbon", /*isOptimized=*/false, /*Flags=*/"", /*RV=*/0); llvm_module_->addModuleFlag(llvm::Module::Max, "Dwarf Version", 5); llvm_module_->addModuleFlag(llvm::Module::Warning, "Debug Info Version", llvm::DEBUG_METADATA_VERSION); From b57a741efe5ed374b5e31dd6b28350ef8b23ee61 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 19 Aug 2024 18:09:47 +0000 Subject: [PATCH 05/11] Rename BuildCompileUnit to BuildDICompileUnit --- toolchain/lower/file_context.cpp | 4 ++-- toolchain/lower/file_context.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index d27418913b697..96482d4c8b895 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -33,7 +33,7 @@ FileContext::FileContext(llvm::LLVMContext& llvm_context, include_debug_info_(include_debug_info) { CARBON_CHECK(!sem_ir.has_errors()) << "Generating LLVM IR from invalid SemIR::File is unsupported."; - BuildCompileUnit(module_name); + BuildDICompileUnit(module_name); } // TODO: Move this to lower.cpp. @@ -70,7 +70,7 @@ auto FileContext::Run() -> std::unique_ptr { return std::move(llvm_module_); } -auto FileContext::BuildCompileUnit(llvm::StringRef module_name) -> void { +auto FileContext::BuildDICompileUnit(llvm::StringRef module_name) -> void { if (!include_debug_info_) { return; } diff --git a/toolchain/lower/file_context.h b/toolchain/lower/file_context.h index e3e9f477b63a6..62f0804ac1551 100644 --- a/toolchain/lower/file_context.h +++ b/toolchain/lower/file_context.h @@ -27,7 +27,7 @@ class FileContext { auto Run() -> std::unique_ptr; // Create the DICompileUnit metadata for this compilation. - auto BuildCompileUnit(llvm::StringRef module_name) -> void; + auto BuildDICompileUnit(llvm::StringRef module_name) -> void; // Gets a callable's function. Returns nullptr for a builtin. auto GetFunction(SemIR::FunctionId function_id) -> llvm::Function* { From 2c6dbf6f88865f8dd231974ae5ddfe53c1f932db Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 19 Aug 2024 18:28:08 +0000 Subject: [PATCH 06/11] Make FileContext::BuildDICompileUnit a factory function (also rename it, adding the 'DI' in the name to match the type and member variable name) This renders `include_debug_info_` unused, so remove it - we can rely on the CU being non-null as the marker for debug info emission in future patches/work. --- toolchain/lower/file_context.cpp | 28 ++++++++++--------- toolchain/lower/file_context.h | 11 +++++--- toolchain/lower/testdata/alias/local.carbon | 12 ++++---- .../testdata/array/array_in_place.carbon | 12 ++++---- .../testdata/array/assign_return_value.carbon | 12 ++++---- toolchain/lower/testdata/array/base.carbon | 12 ++++---- .../testdata/array/function_param.carbon | 12 ++++---- toolchain/lower/testdata/basics/empty.carbon | 12 ++++---- .../lower/testdata/basics/false_true.carbon | 12 ++++---- .../lower/testdata/basics/int_types.carbon | 12 ++++---- .../testdata/basics/numeric_literals.carbon | 12 ++++---- .../lower/testdata/basics/type_values.carbon | 12 ++++---- toolchain/lower/testdata/basics/zero.carbon | 12 ++++---- .../lower/testdata/builtins/float.carbon | 12 ++++---- toolchain/lower/testdata/builtins/int.carbon | 12 ++++---- .../builtins/method_vs_nonmethod.carbon | 12 ++++---- .../builtins/overloaded_operator.carbon | 12 ++++---- .../lower/testdata/builtins/print.carbon | 12 ++++---- .../lower/testdata/builtins/types.carbon | 12 ++++---- toolchain/lower/testdata/builtins/uint.carbon | 12 ++++---- toolchain/lower/testdata/class/adapt.carbon | 24 ++++++++-------- toolchain/lower/testdata/class/base.carbon | 12 ++++---- toolchain/lower/testdata/class/basic.carbon | 12 ++++---- toolchain/lower/testdata/class/field.carbon | 12 ++++---- toolchain/lower/testdata/class/method.carbon | 12 ++++---- toolchain/lower/testdata/class/self.carbon | 12 ++++---- .../lower/testdata/class/value_access.carbon | 12 ++++---- .../function/call/empty_struct.carbon | 12 ++++---- .../testdata/function/call/empty_tuple.carbon | 12 ++++---- .../lower/testdata/function/call/i32.carbon | 12 ++++---- .../call/implicit_empty_tuple_as_arg.carbon | 12 ++++---- .../testdata/function/call/params_one.carbon | 12 ++++---- .../function/call/params_one_comma.carbon | 12 ++++---- .../testdata/function/call/params_two.carbon | 12 ++++---- .../function/call/params_two_comma.carbon | 12 ++++---- .../testdata/function/call/params_zero.carbon | 12 ++++---- .../function/call/return_implicit.carbon | 12 ++++---- .../function/call/struct_param.carbon | 12 ++++---- .../testdata/function/call/tuple_param.carbon | 12 ++++---- .../call/tuple_param_with_return_slot.carbon | 12 ++++---- .../testdata/function/call/var_param.carbon | 12 ++++---- .../function/declaration/simple.carbon | 12 ++++---- .../function/definition/empty_struct.carbon | 12 ++++---- .../function/definition/params_one.carbon | 12 ++++---- .../function/definition/params_two.carbon | 12 ++++---- .../function/definition/params_zero.carbon | 12 ++++---- .../function/generic/type_param.carbon | 12 ++++---- toolchain/lower/testdata/if/else.carbon | 12 ++++---- toolchain/lower/testdata/if/no_else.carbon | 12 ++++---- toolchain/lower/testdata/if_expr/basic.carbon | 12 ++++---- .../lower/testdata/if_expr/empty_block.carbon | 12 ++++---- .../lower/testdata/impl/assoc_fn_alias.carbon | 12 ++++---- .../lower/testdata/impl/extend_impl.carbon | 12 ++++---- toolchain/lower/testdata/impl/impl.carbon | 12 ++++---- .../testdata/impl/instance_method.carbon | 12 ++++---- .../index/array_element_access.carbon | 12 ++++---- .../index/tuple_element_access.carbon | 12 ++++---- .../index/tuple_return_value_access.carbon | 12 ++++---- .../lower/testdata/interface/assoc.carbon | 12 ++++---- .../lower/testdata/interface/basic.carbon | 12 ++++---- toolchain/lower/testdata/let/local.carbon | 12 ++++---- toolchain/lower/testdata/let/tuple.carbon | 12 ++++---- .../lower/testdata/namespace/function.carbon | 12 ++++---- .../lower/testdata/namespace/nested.carbon | 12 ++++---- toolchain/lower/testdata/operators/and.carbon | 12 ++++---- .../testdata/operators/and_empty_block.carbon | 12 ++++---- .../testdata/operators/assignment.carbon | 12 ++++---- toolchain/lower/testdata/operators/not.carbon | 12 ++++---- toolchain/lower/testdata/operators/or.carbon | 12 ++++---- .../testdata/operators/or_empty_block.carbon | 12 ++++---- .../testdata/operators/overloaded.carbon | 12 ++++---- .../packages/cross_package_call.carbon | 24 ++++++++-------- .../testdata/pointer/address_of_field.carbon | 12 ++++---- .../testdata/pointer/address_of_unused.carbon | 12 ++++---- toolchain/lower/testdata/pointer/basic.carbon | 12 ++++---- .../pointer/pointer_to_pointer.carbon | 12 ++++---- .../testdata/return/code_after_return.carbon | 12 ++++---- .../lower/testdata/return/no_value.carbon | 12 ++++---- .../lower/testdata/return/return_var.carbon | 12 ++++---- .../testdata/return/return_var_byval.carbon | 12 ++++---- toolchain/lower/testdata/return/value.carbon | 12 ++++---- toolchain/lower/testdata/return/var.carbon | 12 ++++---- toolchain/lower/testdata/struct/empty.carbon | 12 ++++---- .../testdata/struct/member_access.carbon | 12 ++++---- .../testdata/struct/nested_struct.carbon | 12 ++++---- .../struct/nested_struct_in_place.carbon | 12 ++++---- .../lower/testdata/struct/one_entry.carbon | 12 ++++---- .../lower/testdata/struct/two_entries.carbon | 12 ++++---- toolchain/lower/testdata/tuple/empty.carbon | 12 ++++---- .../lower/testdata/tuple/nested_tuple.carbon | 12 ++++---- .../tuple/nested_tuple_in_place.carbon | 12 ++++---- .../lower/testdata/tuple/one_entry.carbon | 12 ++++---- .../lower/testdata/tuple/two_entries.carbon | 12 ++++---- .../testdata/tuple/value_formation.carbon | 12 ++++---- .../testdata/tuple/value_forwarding.carbon | 12 ++++---- toolchain/lower/testdata/var/local.carbon | 12 ++++---- .../testdata/while/break_continue.carbon | 12 ++++---- .../lower/testdata/while/preheader.carbon | 12 ++++---- .../testdata/while/unreachable_end.carbon | 12 ++++---- toolchain/lower/testdata/while/while.carbon | 12 ++++---- 100 files changed, 622 insertions(+), 617 deletions(-) diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 96482d4c8b895..5956f50d17fa2 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -27,13 +27,15 @@ FileContext::FileContext(llvm::LLVMContext& llvm_context, : llvm_context_(&llvm_context), llvm_module_(std::make_unique(module_name, llvm_context)), di_builder_(*llvm_module_), + di_compile_unit_( + include_debug_info + ? BuildDICompileUnit(module_name, *llvm_module_, di_builder_) + : nullptr), sem_ir_(&sem_ir), inst_namer_(inst_namer), - vlog_stream_(vlog_stream), - include_debug_info_(include_debug_info) { + vlog_stream_(vlog_stream) { CARBON_CHECK(!sem_ir.has_errors()) << "Generating LLVM IR from invalid SemIR::File is unsupported."; - BuildDICompileUnit(module_name); } // TODO: Move this to lower.cpp. @@ -70,21 +72,21 @@ auto FileContext::Run() -> std::unique_ptr { return std::move(llvm_module_); } -auto FileContext::BuildDICompileUnit(llvm::StringRef module_name) -> void { - if (!include_debug_info_) { - return; - } +auto FileContext::BuildDICompileUnit( + llvm::StringRef module_name, llvm::Module& llvm_module, + llvm::DIBuilder& di_builder) -> llvm::DICompileUnit* { + llvm_module.addModuleFlag(llvm::Module::Max, "Dwarf Version", 5); + llvm_module.addModuleFlag(llvm::Module::Warning, "Debug Info Version", + llvm::DEBUG_METADATA_VERSION); // FIXME: Include directory path in the cu_file. - llvm::DIFile* cu_file = di_builder_.createFile(module_name, ""); + llvm::DIFile* cu_file = di_builder.createFile(module_name, ""); // FIXME: Introduce a new language code for Carbon. C works well for now since // it's something debuggers will already know/have support for at least. // Probably have to bump to C++ at some point for virtual functions, // templates, etc. - di_compile_unit_ = di_builder_.createCompileUnit( - llvm::dwarf::DW_LANG_C, cu_file, "carbon", /*isOptimized=*/false, /*Flags=*/"", /*RV=*/0); - llvm_module_->addModuleFlag(llvm::Module::Max, "Dwarf Version", 5); - llvm_module_->addModuleFlag(llvm::Module::Warning, "Debug Info Version", - llvm::DEBUG_METADATA_VERSION); + return di_builder.createCompileUnit(llvm::dwarf::DW_LANG_C, cu_file, "carbon", + /*isOptimized=*/false, /*Flags=*/"", + /*RV=*/0); } auto FileContext::GetGlobal(SemIR::InstId inst_id) -> llvm::Value* { diff --git a/toolchain/lower/file_context.h b/toolchain/lower/file_context.h index 62f0804ac1551..ae97077b46031 100644 --- a/toolchain/lower/file_context.h +++ b/toolchain/lower/file_context.h @@ -27,7 +27,9 @@ class FileContext { auto Run() -> std::unique_ptr; // Create the DICompileUnit metadata for this compilation. - auto BuildDICompileUnit(llvm::StringRef module_name) -> void; + auto BuildDICompileUnit(llvm::StringRef module_name, + llvm::Module& llvm_module, + llvm::DIBuilder& di_builder) -> llvm::DICompileUnit*; // Gets a callable's function. Returns nullptr for a builtin. auto GetFunction(SemIR::FunctionId function_id) -> llvm::Function* { @@ -80,7 +82,11 @@ class FileContext { // State for building the LLVM IR. llvm::LLVMContext* llvm_context_; std::unique_ptr llvm_module_; + + // State for building the LLVM IR debug info metadata. llvm::DIBuilder di_builder_; + + // The DICompileUnit, if any - null implies debug info is not being emitted. llvm::DICompileUnit* di_compile_unit_; // The input SemIR. @@ -107,9 +113,6 @@ class FileContext { // Maps constants to their lowered values. // We resize this directly to the (often large) correct size. llvm::SmallVector constants_; - - // Specify whether to include debug info metadata in the generated LLVM IR. - bool include_debug_info_; }; } // namespace Carbon::Lower diff --git a/toolchain/lower/testdata/alias/local.carbon b/toolchain/lower/testdata/alias/local.carbon index 676d8f210ccdf..c6a86267b4b65 100644 --- a/toolchain/lower/testdata/alias/local.carbon +++ b/toolchain/lower/testdata/alias/local.carbon @@ -25,10 +25,10 @@ fn F() -> i32 { // CHECK:STDOUT: ret i32 %.loc14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "local.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "local.carbon", directory: "") diff --git a/toolchain/lower/testdata/array/array_in_place.carbon b/toolchain/lower/testdata/array/array_in_place.carbon index d0d2a51c53d47..4080e7d5a7633 100644 --- a/toolchain/lower/testdata/array/array_in_place.carbon +++ b/toolchain/lower/testdata/array/array_in_place.carbon @@ -29,10 +29,10 @@ fn G() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "array_in_place.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "array_in_place.carbon", directory: "") diff --git a/toolchain/lower/testdata/array/assign_return_value.carbon b/toolchain/lower/testdata/array/assign_return_value.carbon index 623fa653c8baf..768e1998116b6 100644 --- a/toolchain/lower/testdata/array/assign_return_value.carbon +++ b/toolchain/lower/testdata/array/assign_return_value.carbon @@ -48,10 +48,10 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "assign_return_value.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "assign_return_value.carbon", directory: "") diff --git a/toolchain/lower/testdata/array/base.carbon b/toolchain/lower/testdata/array/base.carbon index 496ece67d6995..cca4b4c5cd582 100644 --- a/toolchain/lower/testdata/array/base.carbon +++ b/toolchain/lower/testdata/array/base.carbon @@ -69,10 +69,10 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "base.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "base.carbon", directory: "") diff --git a/toolchain/lower/testdata/array/function_param.carbon b/toolchain/lower/testdata/array/function_param.carbon index 6657458de7900..c2fff5de11b86 100644 --- a/toolchain/lower/testdata/array/function_param.carbon +++ b/toolchain/lower/testdata/array/function_param.carbon @@ -44,10 +44,10 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "function_param.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "function_param.carbon", directory: "") diff --git a/toolchain/lower/testdata/basics/empty.carbon b/toolchain/lower/testdata/basics/empty.carbon index 7ed97955eb360..de98d7b44b377 100644 --- a/toolchain/lower/testdata/basics/empty.carbon +++ b/toolchain/lower/testdata/basics/empty.carbon @@ -11,10 +11,10 @@ // CHECK:STDOUT: ; ModuleID = 'empty.carbon' // CHECK:STDOUT: source_filename = "empty.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "empty.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "empty.carbon", directory: "") diff --git a/toolchain/lower/testdata/basics/false_true.carbon b/toolchain/lower/testdata/basics/false_true.carbon index c48a68f1c3f0f..5e726303a822a 100644 --- a/toolchain/lower/testdata/basics/false_true.carbon +++ b/toolchain/lower/testdata/basics/false_true.carbon @@ -29,10 +29,10 @@ fn T() -> bool { // CHECK:STDOUT: ret i1 true // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "false_true.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "false_true.carbon", directory: "") diff --git a/toolchain/lower/testdata/basics/int_types.carbon b/toolchain/lower/testdata/basics/int_types.carbon index 920e25b664242..099a23f66427f 100644 --- a/toolchain/lower/testdata/basics/int_types.carbon +++ b/toolchain/lower/testdata/basics/int_types.carbon @@ -36,10 +36,10 @@ fn F_u65536(a: u65536) -> u65536 { return a; } // CHECK:STDOUT: ret i65536 %a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "int_types.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "int_types.carbon", directory: "") diff --git a/toolchain/lower/testdata/basics/numeric_literals.carbon b/toolchain/lower/testdata/basics/numeric_literals.carbon index 0b3e93c6fd13e..1f50d8ac58acb 100644 --- a/toolchain/lower/testdata/basics/numeric_literals.carbon +++ b/toolchain/lower/testdata/basics/numeric_literals.carbon @@ -60,10 +60,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "numeric_literals.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "numeric_literals.carbon", directory: "") diff --git a/toolchain/lower/testdata/basics/type_values.carbon b/toolchain/lower/testdata/basics/type_values.carbon index 658a026eb62e7..385fbeaec9753 100644 --- a/toolchain/lower/testdata/basics/type_values.carbon +++ b/toolchain/lower/testdata/basics/type_values.carbon @@ -43,10 +43,10 @@ fn F64() -> type { // CHECK:STDOUT: ret %type zeroinitializer // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "type_values.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "type_values.carbon", directory: "") diff --git a/toolchain/lower/testdata/basics/zero.carbon b/toolchain/lower/testdata/basics/zero.carbon index 54df83c260b32..a9f3235c6b3de 100644 --- a/toolchain/lower/testdata/basics/zero.carbon +++ b/toolchain/lower/testdata/basics/zero.carbon @@ -20,10 +20,10 @@ fn Main() -> i32 { // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "zero.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "zero.carbon", directory: "") diff --git a/toolchain/lower/testdata/builtins/float.carbon b/toolchain/lower/testdata/builtins/float.carbon index 6e2648d08fb97..9272cd5f03909 100644 --- a/toolchain/lower/testdata/builtins/float.carbon +++ b/toolchain/lower/testdata/builtins/float.carbon @@ -110,10 +110,10 @@ fn TestGreaterEq(a: f64, b: f64) -> bool { return GreaterEq(a, b); } // CHECK:STDOUT: ret i1 %float.greater_eq // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "float.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "float.carbon", directory: "") diff --git a/toolchain/lower/testdata/builtins/int.carbon b/toolchain/lower/testdata/builtins/int.carbon index cdd55a98fb301..6821a5d5657b0 100644 --- a/toolchain/lower/testdata/builtins/int.carbon +++ b/toolchain/lower/testdata/builtins/int.carbon @@ -173,10 +173,10 @@ fn TestGreaterEq(a: i32, b: i32) -> bool { return GreaterEq(a, b); } // CHECK:STDOUT: ret i1 %int.greater_eq // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "int.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "int.carbon", directory: "") diff --git a/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon b/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon index 0a40108b3728d..7a12846df919c 100644 --- a/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon +++ b/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon @@ -29,10 +29,10 @@ fn TestAddMethod(a: i32, b: i32) -> i32 { return a.(AddMethod)(b); } // CHECK:STDOUT: ret i32 %int.sadd // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "method_vs_nonmethod.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "method_vs_nonmethod.carbon", directory: "") diff --git a/toolchain/lower/testdata/builtins/overloaded_operator.carbon b/toolchain/lower/testdata/builtins/overloaded_operator.carbon index 8b63b320e586d..344d6492a952e 100644 --- a/toolchain/lower/testdata/builtins/overloaded_operator.carbon +++ b/toolchain/lower/testdata/builtins/overloaded_operator.carbon @@ -31,10 +31,10 @@ fn AddThreeIntegers(a: i32, b: i32, c: i32) -> i32 { // CHECK:STDOUT: ret i32 %int.sadd.loc18_16 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "overloaded_operator.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "overloaded_operator.carbon", directory: "") diff --git a/toolchain/lower/testdata/builtins/print.carbon b/toolchain/lower/testdata/builtins/print.carbon index c15164baa4f61..7dfd0270f9272 100644 --- a/toolchain/lower/testdata/builtins/print.carbon +++ b/toolchain/lower/testdata/builtins/print.carbon @@ -25,10 +25,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: declare i32 @printf(ptr, ...) // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "print.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "print.carbon", directory: "") diff --git a/toolchain/lower/testdata/builtins/types.carbon b/toolchain/lower/testdata/builtins/types.carbon index af255b27dfeb0..339dbfd802c94 100644 --- a/toolchain/lower/testdata/builtins/types.carbon +++ b/toolchain/lower/testdata/builtins/types.carbon @@ -32,10 +32,10 @@ fn F() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "types.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "types.carbon", directory: "") diff --git a/toolchain/lower/testdata/builtins/uint.carbon b/toolchain/lower/testdata/builtins/uint.carbon index 00c2a7d61ca05..854d6c4fe2ce2 100644 --- a/toolchain/lower/testdata/builtins/uint.carbon +++ b/toolchain/lower/testdata/builtins/uint.carbon @@ -173,10 +173,10 @@ fn TestGreaterEq(a: u64, b: u64) -> bool { return GreaterEq(a, b); } // CHECK:STDOUT: ret i1 %int.greater_eq // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "uint.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "uint.carbon", directory: "") diff --git a/toolchain/lower/testdata/class/adapt.carbon b/toolchain/lower/testdata/class/adapt.carbon index 4e1cb5b0ef99b..4712675af10ac 100644 --- a/toolchain/lower/testdata/class/adapt.carbon +++ b/toolchain/lower/testdata/class/adapt.carbon @@ -90,13 +90,13 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "adapt_class.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "adapt_class.carbon", directory: "") // CHECK:STDOUT: ; ModuleID = 'adapt_int.carbon' // CHECK:STDOUT: source_filename = "adapt_int.carbon" // CHECK:STDOUT: @@ -105,10 +105,10 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: ret i32 %a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "adapt_int.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "adapt_int.carbon", directory: "") diff --git a/toolchain/lower/testdata/class/base.carbon b/toolchain/lower/testdata/class/base.carbon index f9760f8f9b0cc..6efb90d24dc73 100644 --- a/toolchain/lower/testdata/class/base.carbon +++ b/toolchain/lower/testdata/class/base.carbon @@ -69,10 +69,10 @@ fn Convert(p: Derived*) -> Base* { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "base.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "base.carbon", directory: "") diff --git a/toolchain/lower/testdata/class/basic.carbon b/toolchain/lower/testdata/class/basic.carbon index 9f0c70739a08b..cdf6a8ff9053e 100644 --- a/toolchain/lower/testdata/class/basic.carbon +++ b/toolchain/lower/testdata/class/basic.carbon @@ -33,10 +33,10 @@ fn Run() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "basic.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "basic.carbon", directory: "") diff --git a/toolchain/lower/testdata/class/field.carbon b/toolchain/lower/testdata/class/field.carbon index 67c9236e44015..1277a47a4cc5e 100644 --- a/toolchain/lower/testdata/class/field.carbon +++ b/toolchain/lower/testdata/class/field.carbon @@ -47,10 +47,10 @@ fn Run() -> i32 { // CHECK:STDOUT: ret i32 %F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "field.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "field.carbon", directory: "") diff --git a/toolchain/lower/testdata/class/method.carbon b/toolchain/lower/testdata/class/method.carbon index 2e8b661a0e72d..ba7dc13c070e5 100644 --- a/toolchain/lower/testdata/class/method.carbon +++ b/toolchain/lower/testdata/class/method.carbon @@ -34,10 +34,10 @@ fn F(p: C*) { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "method.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "method.carbon", directory: "") diff --git a/toolchain/lower/testdata/class/self.carbon b/toolchain/lower/testdata/class/self.carbon index 517fa4437d486..b069cf06afe37 100644 --- a/toolchain/lower/testdata/class/self.carbon +++ b/toolchain/lower/testdata/class/self.carbon @@ -40,10 +40,10 @@ fn C.Set[addr self: C*]() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "self.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "self.carbon", directory: "") diff --git a/toolchain/lower/testdata/class/value_access.carbon b/toolchain/lower/testdata/class/value_access.carbon index 7959178c5b588..3a97d32f5d989 100644 --- a/toolchain/lower/testdata/class/value_access.carbon +++ b/toolchain/lower/testdata/class/value_access.carbon @@ -43,10 +43,10 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: ret i32 %.loc19_13.tuple.index.load // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "value_access.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "value_access.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/empty_struct.carbon b/toolchain/lower/testdata/function/call/empty_struct.carbon index dce746569bbc0..ee8cd679501dd 100644 --- a/toolchain/lower/testdata/function/call/empty_struct.carbon +++ b/toolchain/lower/testdata/function/call/empty_struct.carbon @@ -31,10 +31,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "empty_struct.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "empty_struct.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/empty_tuple.carbon b/toolchain/lower/testdata/function/call/empty_tuple.carbon index bf7a13e0bc885..1abaae24d5685 100644 --- a/toolchain/lower/testdata/function/call/empty_tuple.carbon +++ b/toolchain/lower/testdata/function/call/empty_tuple.carbon @@ -31,10 +31,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "empty_tuple.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "empty_tuple.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/i32.carbon b/toolchain/lower/testdata/function/call/i32.carbon index 8e42676d432ed..2e29e66739986 100644 --- a/toolchain/lower/testdata/function/call/i32.carbon +++ b/toolchain/lower/testdata/function/call/i32.carbon @@ -32,10 +32,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "i32.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "i32.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon b/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon index 66184ec2e74d2..58325fb8bc104 100644 --- a/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon +++ b/toolchain/lower/testdata/function/call/implicit_empty_tuple_as_arg.carbon @@ -39,10 +39,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "implicit_empty_tuple_as_arg.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "implicit_empty_tuple_as_arg.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/params_one.carbon b/toolchain/lower/testdata/function/call/params_one.carbon index 2bb6decd257a9..9e1852697a90c 100644 --- a/toolchain/lower/testdata/function/call/params_one.carbon +++ b/toolchain/lower/testdata/function/call/params_one.carbon @@ -28,10 +28,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "params_one.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "params_one.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/params_one_comma.carbon b/toolchain/lower/testdata/function/call/params_one_comma.carbon index 0a049c045f6cd..8431533d47807 100644 --- a/toolchain/lower/testdata/function/call/params_one_comma.carbon +++ b/toolchain/lower/testdata/function/call/params_one_comma.carbon @@ -30,10 +30,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "params_one_comma.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "params_one_comma.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/params_two.carbon b/toolchain/lower/testdata/function/call/params_two.carbon index c35ac87c2b602..343414bf62b0b 100644 --- a/toolchain/lower/testdata/function/call/params_two.carbon +++ b/toolchain/lower/testdata/function/call/params_two.carbon @@ -28,10 +28,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "params_two.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "params_two.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/params_two_comma.carbon b/toolchain/lower/testdata/function/call/params_two_comma.carbon index 376f1f0a7fede..ce82f627039d4 100644 --- a/toolchain/lower/testdata/function/call/params_two_comma.carbon +++ b/toolchain/lower/testdata/function/call/params_two_comma.carbon @@ -30,10 +30,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "params_two_comma.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "params_two_comma.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/params_zero.carbon b/toolchain/lower/testdata/function/call/params_zero.carbon index 2fc142b714de9..3f1e052b5c496 100644 --- a/toolchain/lower/testdata/function/call/params_zero.carbon +++ b/toolchain/lower/testdata/function/call/params_zero.carbon @@ -28,10 +28,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "params_zero.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "params_zero.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/return_implicit.carbon b/toolchain/lower/testdata/function/call/return_implicit.carbon index e8423063911a1..61682273d0e3b 100644 --- a/toolchain/lower/testdata/function/call/return_implicit.carbon +++ b/toolchain/lower/testdata/function/call/return_implicit.carbon @@ -31,10 +31,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "return_implicit.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "return_implicit.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/struct_param.carbon b/toolchain/lower/testdata/function/call/struct_param.carbon index 4b280c7e0f94b..f184dc850485d 100644 --- a/toolchain/lower/testdata/function/call/struct_param.carbon +++ b/toolchain/lower/testdata/function/call/struct_param.carbon @@ -30,10 +30,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "struct_param.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "struct_param.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/tuple_param.carbon b/toolchain/lower/testdata/function/call/tuple_param.carbon index 56ece8cb06afb..f155cef1f0012 100644 --- a/toolchain/lower/testdata/function/call/tuple_param.carbon +++ b/toolchain/lower/testdata/function/call/tuple_param.carbon @@ -30,10 +30,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "tuple_param.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "tuple_param.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon b/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon index 6880ea6f7d918..d00e90501acbd 100644 --- a/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon +++ b/toolchain/lower/testdata/function/call/tuple_param_with_return_slot.carbon @@ -47,10 +47,10 @@ fn Main() { // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder i32 1, { 3, 0, 1, 2 } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "tuple_param_with_return_slot.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "tuple_param_with_return_slot.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/call/var_param.carbon b/toolchain/lower/testdata/function/call/var_param.carbon index a126952095056..6c5a606836c18 100644 --- a/toolchain/lower/testdata/function/call/var_param.carbon +++ b/toolchain/lower/testdata/function/call/var_param.carbon @@ -32,10 +32,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "var_param.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "var_param.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/declaration/simple.carbon b/toolchain/lower/testdata/function/declaration/simple.carbon index 79d5f1d6828f5..8d87441bccd9e 100644 --- a/toolchain/lower/testdata/function/declaration/simple.carbon +++ b/toolchain/lower/testdata/function/declaration/simple.carbon @@ -23,10 +23,10 @@ fn G(n: i32) { F(n); } // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "simple.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "simple.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/definition/empty_struct.carbon b/toolchain/lower/testdata/function/definition/empty_struct.carbon index 41f679f9b8fcb..f2485ef74fee5 100644 --- a/toolchain/lower/testdata/function/definition/empty_struct.carbon +++ b/toolchain/lower/testdata/function/definition/empty_struct.carbon @@ -19,10 +19,10 @@ fn Echo(a: {}) { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "empty_struct.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "empty_struct.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/definition/params_one.carbon b/toolchain/lower/testdata/function/definition/params_one.carbon index 639e7406eb3f9..c5e6f8ff4eab4 100644 --- a/toolchain/lower/testdata/function/definition/params_one.carbon +++ b/toolchain/lower/testdata/function/definition/params_one.carbon @@ -18,10 +18,10 @@ fn Foo(a: i32) {} // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "params_one.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "params_one.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/definition/params_two.carbon b/toolchain/lower/testdata/function/definition/params_two.carbon index c72804ea0fe74..37d197109cd9e 100644 --- a/toolchain/lower/testdata/function/definition/params_two.carbon +++ b/toolchain/lower/testdata/function/definition/params_two.carbon @@ -18,10 +18,10 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "params_two.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "params_two.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/definition/params_zero.carbon b/toolchain/lower/testdata/function/definition/params_zero.carbon index 9f442a22625a0..226215750df41 100644 --- a/toolchain/lower/testdata/function/definition/params_zero.carbon +++ b/toolchain/lower/testdata/function/definition/params_zero.carbon @@ -18,10 +18,10 @@ fn Foo() {} // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "params_zero.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "params_zero.carbon", directory: "") diff --git a/toolchain/lower/testdata/function/generic/type_param.carbon b/toolchain/lower/testdata/function/generic/type_param.carbon index 9605ba62143e9..546f1ac0dca50 100644 --- a/toolchain/lower/testdata/function/generic/type_param.carbon +++ b/toolchain/lower/testdata/function/generic/type_param.carbon @@ -16,10 +16,10 @@ fn F(T:! type) { // CHECK:STDOUT: ; ModuleID = 'type_param.carbon' // CHECK:STDOUT: source_filename = "type_param.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "type_param.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "type_param.carbon", directory: "") diff --git a/toolchain/lower/testdata/if/else.carbon b/toolchain/lower/testdata/if/else.carbon index 6da85106798b6..a32ef445aa2f5 100644 --- a/toolchain/lower/testdata/if/else.carbon +++ b/toolchain/lower/testdata/if/else.carbon @@ -56,10 +56,10 @@ fn If(b: bool) { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "else.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "else.carbon", directory: "") diff --git a/toolchain/lower/testdata/if/no_else.carbon b/toolchain/lower/testdata/if/no_else.carbon index b08072dc5b4ba..6e980c9895272 100644 --- a/toolchain/lower/testdata/if/no_else.carbon +++ b/toolchain/lower/testdata/if/no_else.carbon @@ -44,10 +44,10 @@ fn If(b: bool) { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "no_else.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "no_else.carbon", directory: "") diff --git a/toolchain/lower/testdata/if_expr/basic.carbon b/toolchain/lower/testdata/if_expr/basic.carbon index 7e87092aa01a0..635525b59f8dd 100644 --- a/toolchain/lower/testdata/if_expr/basic.carbon +++ b/toolchain/lower/testdata/if_expr/basic.carbon @@ -45,10 +45,10 @@ fn Select(b: bool) -> i32 { // CHECK:STDOUT: ret i32 %0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "basic.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "basic.carbon", directory: "") diff --git a/toolchain/lower/testdata/if_expr/empty_block.carbon b/toolchain/lower/testdata/if_expr/empty_block.carbon index 31fc858f89cd2..332990f17452e 100644 --- a/toolchain/lower/testdata/if_expr/empty_block.carbon +++ b/toolchain/lower/testdata/if_expr/empty_block.carbon @@ -50,10 +50,10 @@ fn Select(b: bool, c: bool, d: bool) -> i32 { // CHECK:STDOUT: ret i32 %2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "empty_block.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "empty_block.carbon", directory: "") diff --git a/toolchain/lower/testdata/impl/assoc_fn_alias.carbon b/toolchain/lower/testdata/impl/assoc_fn_alias.carbon index baba57f64ec0f..a1579b954f195 100644 --- a/toolchain/lower/testdata/impl/assoc_fn_alias.carbon +++ b/toolchain/lower/testdata/impl/assoc_fn_alias.carbon @@ -43,10 +43,10 @@ fn Call(a: A) -> i32 { // CHECK:STDOUT: ret i32 %F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "assoc_fn_alias.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "assoc_fn_alias.carbon", directory: "") diff --git a/toolchain/lower/testdata/impl/extend_impl.carbon b/toolchain/lower/testdata/impl/extend_impl.carbon index 4edf9757ee4f8..c0592d69f686c 100644 --- a/toolchain/lower/testdata/impl/extend_impl.carbon +++ b/toolchain/lower/testdata/impl/extend_impl.carbon @@ -48,10 +48,10 @@ fn InstanceAccess(a: A) -> i32 { // CHECK:STDOUT: ret i32 %F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "extend_impl.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "extend_impl.carbon", directory: "") diff --git a/toolchain/lower/testdata/impl/impl.carbon b/toolchain/lower/testdata/impl/impl.carbon index dbec77ba52175..116106279e103 100644 --- a/toolchain/lower/testdata/impl/impl.carbon +++ b/toolchain/lower/testdata/impl/impl.carbon @@ -42,10 +42,10 @@ fn Call(a: A) -> i32 { // CHECK:STDOUT: ret i32 %F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "impl.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "impl.carbon", directory: "") diff --git a/toolchain/lower/testdata/impl/instance_method.carbon b/toolchain/lower/testdata/impl/instance_method.carbon index de905f9f283ac..88000ebe8e454 100644 --- a/toolchain/lower/testdata/impl/instance_method.carbon +++ b/toolchain/lower/testdata/impl/instance_method.carbon @@ -40,10 +40,10 @@ fn Call(a: A*) -> A* { // CHECK:STDOUT: ret ptr %Get.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "instance_method.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "instance_method.carbon", directory: "") diff --git a/toolchain/lower/testdata/index/array_element_access.carbon b/toolchain/lower/testdata/index/array_element_access.carbon index 689b69e30ea57..570f6965892bf 100644 --- a/toolchain/lower/testdata/index/array_element_access.carbon +++ b/toolchain/lower/testdata/index/array_element_access.carbon @@ -77,10 +77,10 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "array_element_access.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "array_element_access.carbon", directory: "") diff --git a/toolchain/lower/testdata/index/tuple_element_access.carbon b/toolchain/lower/testdata/index/tuple_element_access.carbon index 7ed405f9e2b4f..88de087d2d3ba 100644 --- a/toolchain/lower/testdata/index/tuple_element_access.carbon +++ b/toolchain/lower/testdata/index/tuple_element_access.carbon @@ -43,10 +43,10 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "tuple_element_access.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "tuple_element_access.carbon", directory: "") diff --git a/toolchain/lower/testdata/index/tuple_return_value_access.carbon b/toolchain/lower/testdata/index/tuple_return_value_access.carbon index c5db914086c8c..ac4c6a4b54114 100644 --- a/toolchain/lower/testdata/index/tuple_return_value_access.carbon +++ b/toolchain/lower/testdata/index/tuple_return_value_access.carbon @@ -43,10 +43,10 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "tuple_return_value_access.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "tuple_return_value_access.carbon", directory: "") diff --git a/toolchain/lower/testdata/interface/assoc.carbon b/toolchain/lower/testdata/interface/assoc.carbon index 9b88f9d988bc9..5bed23d53e93c 100644 --- a/toolchain/lower/testdata/interface/assoc.carbon +++ b/toolchain/lower/testdata/interface/assoc.carbon @@ -22,10 +22,10 @@ fn F() { I.Assoc; } // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "assoc.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "assoc.carbon", directory: "") diff --git a/toolchain/lower/testdata/interface/basic.carbon b/toolchain/lower/testdata/interface/basic.carbon index 3946ba7af5f6f..ac9a3fccb3eef 100644 --- a/toolchain/lower/testdata/interface/basic.carbon +++ b/toolchain/lower/testdata/interface/basic.carbon @@ -34,10 +34,10 @@ fn G(T: J) {} // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "basic.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "basic.carbon", directory: "") diff --git a/toolchain/lower/testdata/let/local.carbon b/toolchain/lower/testdata/let/local.carbon index b9a96aae29284..fbd996d852bed 100644 --- a/toolchain/lower/testdata/let/local.carbon +++ b/toolchain/lower/testdata/let/local.carbon @@ -22,10 +22,10 @@ fn Run() -> i32 { // CHECK:STDOUT: ret i32 1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "local.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "local.carbon", directory: "") diff --git a/toolchain/lower/testdata/let/tuple.carbon b/toolchain/lower/testdata/let/tuple.carbon index 8a43ce5716c82..8bcf83b2e6392 100644 --- a/toolchain/lower/testdata/let/tuple.carbon +++ b/toolchain/lower/testdata/let/tuple.carbon @@ -74,10 +74,10 @@ fn F() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "tuple.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "tuple.carbon", directory: "") diff --git a/toolchain/lower/testdata/namespace/function.carbon b/toolchain/lower/testdata/namespace/function.carbon index ded4d4850294c..f022c188de3d7 100644 --- a/toolchain/lower/testdata/namespace/function.carbon +++ b/toolchain/lower/testdata/namespace/function.carbon @@ -40,10 +40,10 @@ fn Bar() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "function.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "function.carbon", directory: "") diff --git a/toolchain/lower/testdata/namespace/nested.carbon b/toolchain/lower/testdata/namespace/nested.carbon index 5ab9373322440..198ef5e13fd93 100644 --- a/toolchain/lower/testdata/namespace/nested.carbon +++ b/toolchain/lower/testdata/namespace/nested.carbon @@ -32,10 +32,10 @@ fn Foo.Bar.Baz() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "nested.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "nested.carbon", directory: "") diff --git a/toolchain/lower/testdata/operators/and.carbon b/toolchain/lower/testdata/operators/and.carbon index 3a3478e88f524..18de3b877cf00 100644 --- a/toolchain/lower/testdata/operators/and.carbon +++ b/toolchain/lower/testdata/operators/and.carbon @@ -42,10 +42,10 @@ fn And() -> bool { // CHECK:STDOUT: ret i1 %0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "and.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "and.carbon", directory: "") diff --git a/toolchain/lower/testdata/operators/and_empty_block.carbon b/toolchain/lower/testdata/operators/and_empty_block.carbon index 937798de18ef8..f8a2aeaebb209 100644 --- a/toolchain/lower/testdata/operators/and_empty_block.carbon +++ b/toolchain/lower/testdata/operators/and_empty_block.carbon @@ -29,10 +29,10 @@ fn And(b: bool, c: bool) -> bool { // CHECK:STDOUT: ret i1 %0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "and_empty_block.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "and_empty_block.carbon", directory: "") diff --git a/toolchain/lower/testdata/operators/assignment.carbon b/toolchain/lower/testdata/operators/assignment.carbon index 88a4a2c321171..7bfe57893041b 100644 --- a/toolchain/lower/testdata/operators/assignment.carbon +++ b/toolchain/lower/testdata/operators/assignment.carbon @@ -37,10 +37,10 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "assignment.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "assignment.carbon", directory: "") diff --git a/toolchain/lower/testdata/operators/not.carbon b/toolchain/lower/testdata/operators/not.carbon index 179d7922c880b..e94d24701f51f 100644 --- a/toolchain/lower/testdata/operators/not.carbon +++ b/toolchain/lower/testdata/operators/not.carbon @@ -21,10 +21,10 @@ fn Not(b: bool) -> bool { // CHECK:STDOUT: ret i1 %.loc12 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "not.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "not.carbon", directory: "") diff --git a/toolchain/lower/testdata/operators/or.carbon b/toolchain/lower/testdata/operators/or.carbon index 6f996bac39545..a045daa2d8375 100644 --- a/toolchain/lower/testdata/operators/or.carbon +++ b/toolchain/lower/testdata/operators/or.carbon @@ -43,10 +43,10 @@ fn Or() -> bool { // CHECK:STDOUT: ret i1 %0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "or.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "or.carbon", directory: "") diff --git a/toolchain/lower/testdata/operators/or_empty_block.carbon b/toolchain/lower/testdata/operators/or_empty_block.carbon index b888eacdacb6f..ee50df2e569d3 100644 --- a/toolchain/lower/testdata/operators/or_empty_block.carbon +++ b/toolchain/lower/testdata/operators/or_empty_block.carbon @@ -30,10 +30,10 @@ fn Or(b: bool, c: bool) -> bool { // CHECK:STDOUT: ret i1 %0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "or_empty_block.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "or_empty_block.carbon", directory: "") diff --git a/toolchain/lower/testdata/operators/overloaded.carbon b/toolchain/lower/testdata/operators/overloaded.carbon index bf103477fbb44..cc3a82d804e86 100644 --- a/toolchain/lower/testdata/operators/overloaded.carbon +++ b/toolchain/lower/testdata/operators/overloaded.carbon @@ -91,10 +91,10 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder i1 true, { 2, 0, 1, 3, 4 } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "overloaded.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "overloaded.carbon", directory: "") diff --git a/toolchain/lower/testdata/packages/cross_package_call.carbon b/toolchain/lower/testdata/packages/cross_package_call.carbon index e8efc25d18c58..11960438b016f 100644 --- a/toolchain/lower/testdata/packages/cross_package_call.carbon +++ b/toolchain/lower/testdata/packages/cross_package_call.carbon @@ -28,13 +28,13 @@ fn G() { A.F(); } // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "a.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "a.carbon", directory: "") // CHECK:STDOUT: ; ModuleID = 'b.carbon' // CHECK:STDOUT: source_filename = "b.carbon" // CHECK:STDOUT: @@ -46,10 +46,10 @@ fn G() { A.F(); } // CHECK:STDOUT: // CHECK:STDOUT: declare void @F() // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "b.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "b.carbon", directory: "") diff --git a/toolchain/lower/testdata/pointer/address_of_field.carbon b/toolchain/lower/testdata/pointer/address_of_field.carbon index 45542687c8919..17152c3d8ba7d 100644 --- a/toolchain/lower/testdata/pointer/address_of_field.carbon +++ b/toolchain/lower/testdata/pointer/address_of_field.carbon @@ -38,10 +38,10 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "address_of_field.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "address_of_field.carbon", directory: "") diff --git a/toolchain/lower/testdata/pointer/address_of_unused.carbon b/toolchain/lower/testdata/pointer/address_of_unused.carbon index 0502b5a6df7ff..d639108d95097 100644 --- a/toolchain/lower/testdata/pointer/address_of_unused.carbon +++ b/toolchain/lower/testdata/pointer/address_of_unused.carbon @@ -23,10 +23,10 @@ fn F() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "address_of_unused.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "address_of_unused.carbon", directory: "") diff --git a/toolchain/lower/testdata/pointer/basic.carbon b/toolchain/lower/testdata/pointer/basic.carbon index 192aeae8f1249..194dd15d82192 100644 --- a/toolchain/lower/testdata/pointer/basic.carbon +++ b/toolchain/lower/testdata/pointer/basic.carbon @@ -34,10 +34,10 @@ fn F() -> i32 { // CHECK:STDOUT: ret i32 %G.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "basic.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "basic.carbon", directory: "") diff --git a/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon b/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon index 75f081080d8c3..50994234dcf0a 100644 --- a/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon +++ b/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon @@ -33,10 +33,10 @@ fn F(p: i32**) -> i32 { // CHECK:STDOUT: ret i32 %.loc15_10.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "pointer_to_pointer.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "pointer_to_pointer.carbon", directory: "") diff --git a/toolchain/lower/testdata/return/code_after_return.carbon b/toolchain/lower/testdata/return/code_after_return.carbon index 5d72cc609322e..84a23dc32c789 100644 --- a/toolchain/lower/testdata/return/code_after_return.carbon +++ b/toolchain/lower/testdata/return/code_after_return.carbon @@ -28,10 +28,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "code_after_return.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "code_after_return.carbon", directory: "") diff --git a/toolchain/lower/testdata/return/no_value.carbon b/toolchain/lower/testdata/return/no_value.carbon index f4fa80acfce3b..d5a068b8b2fc8 100644 --- a/toolchain/lower/testdata/return/no_value.carbon +++ b/toolchain/lower/testdata/return/no_value.carbon @@ -20,10 +20,10 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "no_value.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "no_value.carbon", directory: "") diff --git a/toolchain/lower/testdata/return/return_var.carbon b/toolchain/lower/testdata/return/return_var.carbon index a01fb8cceaf92..9fe416aadd6a9 100644 --- a/toolchain/lower/testdata/return/return_var.carbon +++ b/toolchain/lower/testdata/return/return_var.carbon @@ -30,10 +30,10 @@ fn Make() -> C { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "return_var.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "return_var.carbon", directory: "") diff --git a/toolchain/lower/testdata/return/return_var_byval.carbon b/toolchain/lower/testdata/return/return_var_byval.carbon index 36d2786f28a06..97e9e857d7b72 100644 --- a/toolchain/lower/testdata/return/return_var_byval.carbon +++ b/toolchain/lower/testdata/return/return_var_byval.carbon @@ -24,10 +24,10 @@ fn Main() -> i32 { // CHECK:STDOUT: ret i32 %.loc12_16 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "return_var_byval.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "return_var_byval.carbon", directory: "") diff --git a/toolchain/lower/testdata/return/value.carbon b/toolchain/lower/testdata/return/value.carbon index b52d764cbfb42..66eded6f5fbdd 100644 --- a/toolchain/lower/testdata/return/value.carbon +++ b/toolchain/lower/testdata/return/value.carbon @@ -20,10 +20,10 @@ fn Main() -> i32 { // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "value.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "value.carbon", directory: "") diff --git a/toolchain/lower/testdata/return/var.carbon b/toolchain/lower/testdata/return/var.carbon index f9ccee855de68..dfbe465a4134c 100644 --- a/toolchain/lower/testdata/return/var.carbon +++ b/toolchain/lower/testdata/return/var.carbon @@ -24,10 +24,10 @@ fn Main() -> i32 { // CHECK:STDOUT: ret i32 %.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "var.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "var.carbon", directory: "") diff --git a/toolchain/lower/testdata/struct/empty.carbon b/toolchain/lower/testdata/struct/empty.carbon index 45057b320d017..b85518f3367e5 100644 --- a/toolchain/lower/testdata/struct/empty.carbon +++ b/toolchain/lower/testdata/struct/empty.carbon @@ -24,10 +24,10 @@ fn Run() -> i32 { // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "empty.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "empty.carbon", directory: "") diff --git a/toolchain/lower/testdata/struct/member_access.carbon b/toolchain/lower/testdata/struct/member_access.carbon index 50f08517ad6df..81e0f2304a128 100644 --- a/toolchain/lower/testdata/struct/member_access.carbon +++ b/toolchain/lower/testdata/struct/member_access.carbon @@ -41,10 +41,10 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "member_access.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "member_access.carbon", directory: "") diff --git a/toolchain/lower/testdata/struct/nested_struct.carbon b/toolchain/lower/testdata/struct/nested_struct.carbon index 4283540cdc7ef..6e93fd79d5dbf 100644 --- a/toolchain/lower/testdata/struct/nested_struct.carbon +++ b/toolchain/lower/testdata/struct/nested_struct.carbon @@ -21,10 +21,10 @@ fn Run() -> i32 { // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "nested_struct.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "nested_struct.carbon", directory: "") diff --git a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon index ea10ddc165f67..549fda3591084 100644 --- a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon @@ -29,10 +29,10 @@ fn G() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "nested_struct_in_place.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "nested_struct_in_place.carbon", directory: "") diff --git a/toolchain/lower/testdata/struct/one_entry.carbon b/toolchain/lower/testdata/struct/one_entry.carbon index 14c4ee49eadc2..657665963d9a3 100644 --- a/toolchain/lower/testdata/struct/one_entry.carbon +++ b/toolchain/lower/testdata/struct/one_entry.carbon @@ -29,10 +29,10 @@ fn Run() -> i32 { // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "one_entry.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "one_entry.carbon", directory: "") diff --git a/toolchain/lower/testdata/struct/two_entries.carbon b/toolchain/lower/testdata/struct/two_entries.carbon index c03a5f401687e..9e3c9e146d26b 100644 --- a/toolchain/lower/testdata/struct/two_entries.carbon +++ b/toolchain/lower/testdata/struct/two_entries.carbon @@ -42,10 +42,10 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "two_entries.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "two_entries.carbon", directory: "") diff --git a/toolchain/lower/testdata/tuple/empty.carbon b/toolchain/lower/testdata/tuple/empty.carbon index 1a8e29fdb64ae..71c06b1c52105 100644 --- a/toolchain/lower/testdata/tuple/empty.carbon +++ b/toolchain/lower/testdata/tuple/empty.carbon @@ -24,10 +24,10 @@ fn Run() -> i32 { // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "empty.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "empty.carbon", directory: "") diff --git a/toolchain/lower/testdata/tuple/nested_tuple.carbon b/toolchain/lower/testdata/tuple/nested_tuple.carbon index 7a7b503555514..41e287e44a9af 100644 --- a/toolchain/lower/testdata/tuple/nested_tuple.carbon +++ b/toolchain/lower/testdata/tuple/nested_tuple.carbon @@ -21,10 +21,10 @@ fn Run() -> i32 { // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "nested_tuple.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "nested_tuple.carbon", directory: "") diff --git a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon index 6a057fca0e5c9..6437a64c1d63c 100644 --- a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon @@ -29,10 +29,10 @@ fn G() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "nested_tuple_in_place.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "nested_tuple_in_place.carbon", directory: "") diff --git a/toolchain/lower/testdata/tuple/one_entry.carbon b/toolchain/lower/testdata/tuple/one_entry.carbon index 45ed31fef7de9..0da72917bb1fa 100644 --- a/toolchain/lower/testdata/tuple/one_entry.carbon +++ b/toolchain/lower/testdata/tuple/one_entry.carbon @@ -32,10 +32,10 @@ fn Run() -> i32 { // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder i32 1, { 0, 2, 1 } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "one_entry.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "one_entry.carbon", directory: "") diff --git a/toolchain/lower/testdata/tuple/two_entries.carbon b/toolchain/lower/testdata/tuple/two_entries.carbon index bfa760e648601..ee339ca236c5d 100644 --- a/toolchain/lower/testdata/tuple/two_entries.carbon +++ b/toolchain/lower/testdata/tuple/two_entries.carbon @@ -42,10 +42,10 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "two_entries.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "two_entries.carbon", directory: "") diff --git a/toolchain/lower/testdata/tuple/value_formation.carbon b/toolchain/lower/testdata/tuple/value_formation.carbon index e25a4f2673d86..27c3dc01147b0 100644 --- a/toolchain/lower/testdata/tuple/value_formation.carbon +++ b/toolchain/lower/testdata/tuple/value_formation.carbon @@ -60,10 +60,10 @@ fn F() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "value_formation.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "value_formation.carbon", directory: "") diff --git a/toolchain/lower/testdata/tuple/value_forwarding.carbon b/toolchain/lower/testdata/tuple/value_forwarding.carbon index c6d0570602088..d35387e7025f0 100644 --- a/toolchain/lower/testdata/tuple/value_forwarding.carbon +++ b/toolchain/lower/testdata/tuple/value_forwarding.carbon @@ -30,10 +30,10 @@ fn F(a: (i32, i32, i32), b: (i32, i32, i32)) { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "value_forwarding.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "value_forwarding.carbon", directory: "") diff --git a/toolchain/lower/testdata/var/local.carbon b/toolchain/lower/testdata/var/local.carbon index d59524161abde..01a069d9a9fd8 100644 --- a/toolchain/lower/testdata/var/local.carbon +++ b/toolchain/lower/testdata/var/local.carbon @@ -24,10 +24,10 @@ fn Run() -> i32 { // CHECK:STDOUT: ret i32 %.loc13 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "local.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "local.carbon", directory: "") diff --git a/toolchain/lower/testdata/while/break_continue.carbon b/toolchain/lower/testdata/while/break_continue.carbon index 46075a6532b14..49403fc6baad1 100644 --- a/toolchain/lower/testdata/while/break_continue.carbon +++ b/toolchain/lower/testdata/while/break_continue.carbon @@ -60,10 +60,10 @@ fn While() { // CHECK:STDOUT: uselistorder label %while.cond, { 1, 2, 0 } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "break_continue.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "break_continue.carbon", directory: "") diff --git a/toolchain/lower/testdata/while/preheader.carbon b/toolchain/lower/testdata/while/preheader.carbon index a2005c848b775..b131890e633d6 100644 --- a/toolchain/lower/testdata/while/preheader.carbon +++ b/toolchain/lower/testdata/while/preheader.carbon @@ -71,10 +71,10 @@ fn While() { // CHECK:STDOUT: uselistorder label %while.cond.loc20, { 1, 0 } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "preheader.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "preheader.carbon", directory: "") diff --git a/toolchain/lower/testdata/while/unreachable_end.carbon b/toolchain/lower/testdata/while/unreachable_end.carbon index a9f2421185f7e..5e2d1a71da38f 100644 --- a/toolchain/lower/testdata/while/unreachable_end.carbon +++ b/toolchain/lower/testdata/while/unreachable_end.carbon @@ -52,10 +52,10 @@ fn While() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "unreachable_end.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "unreachable_end.carbon", directory: "") diff --git a/toolchain/lower/testdata/while/while.carbon b/toolchain/lower/testdata/while/while.carbon index 8b88d14cceaf1..9a408935627ce 100644 --- a/toolchain/lower/testdata/while/while.carbon +++ b/toolchain/lower/testdata/while/while.carbon @@ -51,10 +51,10 @@ fn While() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: !llvm.dbg.cu = !{!0} -// CHECK:STDOUT: !llvm.module.flags = !{!2, !3} +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} // CHECK:STDOUT: -// CHECK:STDOUT: !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !1 = !DIFile(filename: "while.carbon", directory: "") -// CHECK:STDOUT: !2 = !{i32 7, !"Dwarf Version", i32 5} -// CHECK:STDOUT: !3 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "while.carbon", directory: "") From 5a9a820e62516f2bdf7d0c64ff1df70dfe763ebe Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 19 Aug 2024 18:30:22 +0000 Subject: [PATCH 07/11] Rename cu_file to compile_unit_file for clarity --- toolchain/lower/file_context.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 5956f50d17fa2..d2f3fefe37046 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -78,13 +78,14 @@ auto FileContext::BuildDICompileUnit( llvm_module.addModuleFlag(llvm::Module::Max, "Dwarf Version", 5); llvm_module.addModuleFlag(llvm::Module::Warning, "Debug Info Version", llvm::DEBUG_METADATA_VERSION); - // FIXME: Include directory path in the cu_file. - llvm::DIFile* cu_file = di_builder.createFile(module_name, ""); + // FIXME: Include directory path in the compile_unit_file. + llvm::DIFile* compile_unit_file = di_builder.createFile(module_name, ""); // FIXME: Introduce a new language code for Carbon. C works well for now since // it's something debuggers will already know/have support for at least. // Probably have to bump to C++ at some point for virtual functions, // templates, etc. - return di_builder.createCompileUnit(llvm::dwarf::DW_LANG_C, cu_file, "carbon", + return di_builder.createCompileUnit(llvm::dwarf::DW_LANG_C, compile_unit_file, + "carbon", /*isOptimized=*/false, /*Flags=*/"", /*RV=*/0); } From 4e57de99c3d9aba120630252dbe957ef84daee5b Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 19 Aug 2024 18:36:02 +0000 Subject: [PATCH 08/11] clang-format --- toolchain/lower/file_context.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index d2f3fefe37046..4a0c01ba94c47 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -72,9 +72,10 @@ auto FileContext::Run() -> std::unique_ptr { return std::move(llvm_module_); } -auto FileContext::BuildDICompileUnit( - llvm::StringRef module_name, llvm::Module& llvm_module, - llvm::DIBuilder& di_builder) -> llvm::DICompileUnit* { +auto FileContext::BuildDICompileUnit(llvm::StringRef module_name, + llvm::Module& llvm_module, + llvm::DIBuilder& di_builder) + -> llvm::DICompileUnit* { llvm_module.addModuleFlag(llvm::Module::Max, "Dwarf Version", 5); llvm_module.addModuleFlag(llvm::Module::Warning, "Debug Info Version", llvm::DEBUG_METADATA_VERSION); From dd996bdb56a56443d723c130e9d4268a4721d603 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 20 Aug 2024 18:57:56 +0000 Subject: [PATCH 09/11] Update tests --- toolchain/lower/testdata/global/class_obj.carbon | 8 ++++++++ toolchain/lower/testdata/global/class_with_fun.carbon | 8 ++++++++ toolchain/lower/testdata/global/decl.carbon | 8 ++++++++ toolchain/lower/testdata/global/simple_init.carbon | 8 ++++++++ toolchain/lower/testdata/global/simple_with_fun.carbon | 8 ++++++++ .../lower/testdata/tuple/access/element_access.carbon | 2 +- .../testdata/tuple/access/return_value_access.carbon | 2 +- 7 files changed, 42 insertions(+), 2 deletions(-) diff --git a/toolchain/lower/testdata/global/class_obj.carbon b/toolchain/lower/testdata/global/class_obj.carbon index f29ffdb413548..c3d8b99a946a6 100644 --- a/toolchain/lower/testdata/global/class_obj.carbon +++ b/toolchain/lower/testdata/global/class_obj.carbon @@ -28,3 +28,11 @@ var a: A = {}; // CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "class_obj.carbon", directory: "") diff --git a/toolchain/lower/testdata/global/class_with_fun.carbon b/toolchain/lower/testdata/global/class_with_fun.carbon index 290324de43f2b..e8b1a82317ffe 100644 --- a/toolchain/lower/testdata/global/class_with_fun.carbon +++ b/toolchain/lower/testdata/global/class_with_fun.carbon @@ -42,3 +42,11 @@ var a: A = {}; // CHECK:STDOUT: uselistorder ptr @llvm.memcpy.p0.p0.i64, { 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "class_with_fun.carbon", directory: "") diff --git a/toolchain/lower/testdata/global/decl.carbon b/toolchain/lower/testdata/global/decl.carbon index ba68e1b4973ed..be0ac140c9857 100644 --- a/toolchain/lower/testdata/global/decl.carbon +++ b/toolchain/lower/testdata/global/decl.carbon @@ -13,3 +13,11 @@ var a: i32; // CHECK:STDOUT: source_filename = "decl.carbon" // CHECK:STDOUT: // CHECK:STDOUT: @a = internal global i32 +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "decl.carbon", directory: "") diff --git a/toolchain/lower/testdata/global/simple_init.carbon b/toolchain/lower/testdata/global/simple_init.carbon index b1f376eb327ad..6425273ea606a 100644 --- a/toolchain/lower/testdata/global/simple_init.carbon +++ b/toolchain/lower/testdata/global/simple_init.carbon @@ -23,3 +23,11 @@ var a: i32 = 0; // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder i32 0, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "simple_init.carbon", directory: "") diff --git a/toolchain/lower/testdata/global/simple_with_fun.carbon b/toolchain/lower/testdata/global/simple_with_fun.carbon index 164c5bbd27963..5e988e81a9346 100644 --- a/toolchain/lower/testdata/global/simple_with_fun.carbon +++ b/toolchain/lower/testdata/global/simple_with_fun.carbon @@ -34,3 +34,11 @@ var a: i32 = test_a(); // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder i32 0, { 1, 0 } +// CHECK:STDOUT: +// CHECK:STDOUT: !llvm.module.flags = !{!0, !1} +// CHECK:STDOUT: !llvm.dbg.cu = !{!2} +// CHECK:STDOUT: +// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} +// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} +// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) +// CHECK:STDOUT: !3 = !DIFile(filename: "simple_with_fun.carbon", directory: "") diff --git a/toolchain/lower/testdata/tuple/access/element_access.carbon b/toolchain/lower/testdata/tuple/access/element_access.carbon index d8bcd25a6268b..84ef16fd5de13 100644 --- a/toolchain/lower/testdata/tuple/access/element_access.carbon +++ b/toolchain/lower/testdata/tuple/access/element_access.carbon @@ -49,4 +49,4 @@ fn Run() -> i32 { // CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !3 = !DIFile(filename: "tuple_element_access.carbon", directory: "") +// CHECK:STDOUT: !3 = !DIFile(filename: "element_access.carbon", directory: "") diff --git a/toolchain/lower/testdata/tuple/access/return_value_access.carbon b/toolchain/lower/testdata/tuple/access/return_value_access.carbon index f302c55537069..775ce1e8cea0b 100644 --- a/toolchain/lower/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/lower/testdata/tuple/access/return_value_access.carbon @@ -49,4 +49,4 @@ fn Run() { // CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5} // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) -// CHECK:STDOUT: !3 = !DIFile(filename: "tuple_return_value_access.carbon", directory: "") +// CHECK:STDOUT: !3 = !DIFile(filename: "return_value_access.carbon", directory: "") From dd0098d994c92835e9906794cca0bc3c381afb85 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 20 Aug 2024 19:27:15 +0000 Subject: [PATCH 10/11] Add test for driver flag compatibility error --- toolchain/driver/testdata/fail_flags.carbon | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 toolchain/driver/testdata/fail_flags.carbon diff --git a/toolchain/driver/testdata/fail_flags.carbon b/toolchain/driver/testdata/fail_flags.carbon new file mode 100644 index 0000000000000..f32c2f3cf24ac --- /dev/null +++ b/toolchain/driver/testdata/fail_flags.carbon @@ -0,0 +1,13 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// ARGS: compile --debug-info --phase=check %s +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/fail_flags.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/fail_flags.carbon +// +// CHECK:STDERR: ERROR: Requested debug info but compile phase is limited to 'check'. From 84dd9fecd8fdb225214ceb49f96a580acb00d4ae Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 20 Aug 2024 19:40:08 +0000 Subject: [PATCH 11/11] Autoupdate tests --- toolchain/driver/testdata/fail_flags.carbon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/driver/testdata/fail_flags.carbon b/toolchain/driver/testdata/fail_flags.carbon index f32c2f3cf24ac..3b68f5118f11c 100644 --- a/toolchain/driver/testdata/fail_flags.carbon +++ b/toolchain/driver/testdata/fail_flags.carbon @@ -9,5 +9,5 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/fail_flags.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/fail_flags.carbon -// // CHECK:STDERR: ERROR: Requested debug info but compile phase is limited to 'check'. +//