From ea8ad22a1742f5d87c1a3c1c01a584504d1a7152 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 22 Aug 2024 10:19:30 -0700 Subject: [PATCH] Add function debug info descriptions (#4233) Still doesn't have line tables, so of limited value (at least now this'll be enough that LLVM really generates debug info into the resulting object file (whereas with only the compilation unit metadata, LLVM will consider it empty and avoid emitting any of it)) - but another step along the path. This also doesn't attach the right source location to the functions - I'll do that in a follow-up change because I think it'll require the majority of the refactoring between driver and check to extract the essential functionality sem_ir_diagnostic_converter, I think, to allow retrieving source locations during lowering. --------- Co-authored-by: Jon Ross-Perkins --- toolchain/lower/file_context.cpp | 20 +++++++ toolchain/lower/file_context.h | 5 ++ toolchain/lower/testdata/alias/local.carbon | 5 +- .../testdata/array/array_in_place.carbon | 5 +- .../testdata/array/assign_return_value.carbon | 8 ++- toolchain/lower/testdata/array/base.carbon | 5 +- .../testdata/array/function_param.carbon | 8 ++- .../lower/testdata/basics/false_true.carbon | 8 ++- .../lower/testdata/basics/int_types.carbon | 14 +++-- .../testdata/basics/numeric_literals.carbon | 5 +- .../lower/testdata/basics/type_values.carbon | 11 +++- toolchain/lower/testdata/basics/zero.carbon | 5 +- .../lower/testdata/builtins/float.carbon | 35 ++++++++---- toolchain/lower/testdata/builtins/int.carbon | 56 +++++++++++++------ .../builtins/method_vs_nonmethod.carbon | 8 ++- .../builtins/overloaded_operator.carbon | 5 +- .../lower/testdata/builtins/print.carbon | 5 +- .../lower/testdata/builtins/types.carbon | 5 +- toolchain/lower/testdata/builtins/uint.carbon | 56 +++++++++++++------ toolchain/lower/testdata/class/adapt.carbon | 19 +++++-- toolchain/lower/testdata/class/base.carbon | 11 +++- toolchain/lower/testdata/class/basic.carbon | 5 +- toolchain/lower/testdata/class/field.carbon | 8 ++- toolchain/lower/testdata/class/method.carbon | 5 +- toolchain/lower/testdata/class/self.carbon | 8 ++- .../lower/testdata/class/value_access.carbon | 5 +- .../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 | 11 +++- .../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 | 5 +- .../function/definition/empty_struct.carbon | 5 +- .../function/definition/params_one.carbon | 5 +- .../function/definition/params_two.carbon | 5 +- .../function/definition/params_zero.carbon | 5 +- .../lower/testdata/global/class_obj.carbon | 5 +- .../testdata/global/class_with_fun.carbon | 8 ++- .../lower/testdata/global/simple_init.carbon | 5 +- .../testdata/global/simple_with_fun.carbon | 8 ++- toolchain/lower/testdata/if/else.carbon | 14 +++-- toolchain/lower/testdata/if/no_else.carbon | 11 +++- toolchain/lower/testdata/if_expr/basic.carbon | 11 +++- .../lower/testdata/if_expr/empty_block.carbon | 5 +- .../lower/testdata/impl/assoc_fn_alias.carbon | 8 ++- .../lower/testdata/impl/extend_impl.carbon | 11 +++- toolchain/lower/testdata/impl/impl.carbon | 8 ++- .../testdata/impl/instance_method.carbon | 8 ++- .../index/array_element_access.carbon | 11 +++- .../lower/testdata/interface/assoc.carbon | 5 +- .../lower/testdata/interface/basic.carbon | 8 ++- toolchain/lower/testdata/let/local.carbon | 5 +- toolchain/lower/testdata/let/tuple.carbon | 5 +- .../lower/testdata/namespace/function.carbon | 11 +++- .../lower/testdata/namespace/nested.carbon | 8 ++- toolchain/lower/testdata/operators/and.carbon | 11 +++- .../testdata/operators/and_empty_block.carbon | 5 +- .../testdata/operators/assignment.carbon | 5 +- toolchain/lower/testdata/operators/not.carbon | 5 +- toolchain/lower/testdata/operators/or.carbon | 11 +++- .../testdata/operators/or_empty_block.carbon | 5 +- .../testdata/operators/overloaded.carbon | 11 +++- .../packages/cross_package_call.carbon | 10 +++- .../testdata/pointer/address_of_field.carbon | 5 +- .../testdata/pointer/address_of_unused.carbon | 5 +- toolchain/lower/testdata/pointer/basic.carbon | 8 ++- .../pointer/pointer_to_pointer.carbon | 5 +- .../testdata/return/code_after_return.carbon | 8 ++- .../lower/testdata/return/no_value.carbon | 5 +- .../lower/testdata/return/return_var.carbon | 5 +- .../testdata/return/return_var_byval.carbon | 5 +- toolchain/lower/testdata/return/value.carbon | 5 +- toolchain/lower/testdata/return/var.carbon | 5 +- toolchain/lower/testdata/struct/empty.carbon | 5 +- .../testdata/struct/member_access.carbon | 5 +- .../testdata/struct/nested_struct.carbon | 5 +- .../struct/nested_struct_in_place.carbon | 5 +- .../lower/testdata/struct/one_entry.carbon | 5 +- .../lower/testdata/struct/two_entries.carbon | 5 +- .../tuple/access/element_access.carbon | 5 +- .../tuple/access/return_value_access.carbon | 8 ++- toolchain/lower/testdata/tuple/empty.carbon | 5 +- .../lower/testdata/tuple/nested_tuple.carbon | 5 +- .../tuple/nested_tuple_in_place.carbon | 5 +- .../lower/testdata/tuple/one_entry.carbon | 5 +- .../lower/testdata/tuple/two_entries.carbon | 5 +- .../testdata/tuple/value_formation.carbon | 5 +- .../testdata/tuple/value_forwarding.carbon | 5 +- toolchain/lower/testdata/var/local.carbon | 5 +- .../testdata/while/break_continue.carbon | 5 +- .../lower/testdata/while/preheader.carbon | 5 +- .../testdata/while/unreachable_end.carbon | 5 +- toolchain/lower/testdata/while/while.carbon | 5 +- 102 files changed, 641 insertions(+), 206 deletions(-) diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 397c86ba325b..d0bb90b3e85b 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -289,6 +289,8 @@ auto FileContext::BuildFunctionDefinition(SemIR::FunctionId function_id) return; } + llvm_function->setSubprogram(BuildDISubprogram(function, llvm_function)); + FunctionContext function_lowering(*this, llvm_function, vlog_stream_); // TODO: Pass in a specific ID for generic functions. @@ -360,6 +362,24 @@ auto FileContext::BuildFunctionDefinition(SemIR::FunctionId function_id) } } +auto FileContext::BuildDISubprogram(const SemIR::Function& /*function*/, + const llvm::Function* llvm_function) + -> llvm::DISubprogram* { + if (!di_compile_unit_) { + return nullptr; + } + // FIXME: Add more details here, including mangled name, real subroutine type + // (once type information is built), etc. + return di_builder_.createFunction( + di_compile_unit_, llvm_function->getName(), /*LinkageName=*/"", + /*File=*/nullptr, + /*LineNo=*/0, + di_builder_.createSubroutineType( + di_builder_.getOrCreateTypeArray(std::nullopt)), + /*ScopeLine=*/0, llvm::DINode::FlagZero, + llvm::DISubprogram::SPFlagDefinition); +} + static auto BuildTypeForInst(FileContext& context, SemIR::ArrayType inst) -> llvm::Type* { return llvm::ArrayType::get( diff --git a/toolchain/lower/file_context.h b/toolchain/lower/file_context.h index 844092cc7069..487d75e5bc17 100644 --- a/toolchain/lower/file_context.h +++ b/toolchain/lower/file_context.h @@ -78,6 +78,11 @@ class FileContext { // declaration with no definition, does nothing. auto BuildFunctionDefinition(SemIR::FunctionId function_id) -> void; + // Build the DISubprogram metadata for the given function. + auto BuildDISubprogram(const SemIR::Function& function, + const llvm::Function* llvm_function) + -> llvm::DISubprogram*; + // Builds the type for the given instruction, which should then be cached by // the caller. auto BuildType(SemIR::InstId inst_id) -> llvm::Type*; diff --git a/toolchain/lower/testdata/alias/local.carbon b/toolchain/lower/testdata/alias/local.carbon index c6a86267b4b6..8b0fa4e5a09a 100644 --- a/toolchain/lower/testdata/alias/local.carbon +++ b/toolchain/lower/testdata/alias/local.carbon @@ -17,7 +17,7 @@ fn F() -> i32 { // CHECK:STDOUT: ; ModuleID = 'local.carbon' // CHECK:STDOUT: source_filename = "local.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F() { +// CHECK:STDOUT: define i32 @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca i32, align 4 // CHECK:STDOUT: store i32 0, ptr %a.var, align 4 @@ -32,3 +32,6 @@ fn F() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/array/array_in_place.carbon b/toolchain/lower/testdata/array/array_in_place.carbon index 4080e7d5a763..9c483acb0807 100644 --- a/toolchain/lower/testdata/array/array_in_place.carbon +++ b/toolchain/lower/testdata/array/array_in_place.carbon @@ -19,7 +19,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: declare void @F(ptr sret({ i32, i32, i32 })) // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() { +// CHECK:STDOUT: define void @G() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca [2 x { i32, i32, i32 }], align 8 // CHECK:STDOUT: %.loc14_42.2.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, i32 0 @@ -36,3 +36,6 @@ fn G() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/array/assign_return_value.carbon b/toolchain/lower/testdata/array/assign_return_value.carbon index 768e1998116b..267531b06def 100644 --- a/toolchain/lower/testdata/array/assign_return_value.carbon +++ b/toolchain/lower/testdata/array/assign_return_value.carbon @@ -19,7 +19,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: @tuple.loc11_39 = internal constant { i32, i32 } { i32 12, i32 24 } // CHECK:STDOUT: -// CHECK:STDOUT: define void @F(ptr sret({ i32, i32 }) %return) { +// CHECK:STDOUT: define void @F(ptr sret({ i32, i32 }) %return) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc11_38.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0 // CHECK:STDOUT: %.loc11_38.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1 @@ -27,7 +27,7 @@ fn Run() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @main() { +// CHECK:STDOUT: define void @main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %t.var = alloca [2 x i32], align 4 // CHECK:STDOUT: %.loc14_22.1.temp = alloca { i32, i32 }, align 8 @@ -55,3 +55,7 @@ fn Run() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/array/base.carbon b/toolchain/lower/testdata/array/base.carbon index cca4b4c5cd58..df022634d8f9 100644 --- a/toolchain/lower/testdata/array/base.carbon +++ b/toolchain/lower/testdata/array/base.carbon @@ -24,7 +24,7 @@ fn Run() { // CHECK:STDOUT: @array.3.loc14_41 = internal constant [5 x {}] zeroinitializer // CHECK:STDOUT: @tuple.2.loc15_37 = internal constant { i32, i32, i32 } { i32 1, i32 2, i32 3 } // CHECK:STDOUT: -// CHECK:STDOUT: define void @main() { +// CHECK:STDOUT: define void @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca [1 x i32], align 4 // CHECK:STDOUT: %.loc12_24.3.array.index = getelementptr inbounds [1 x i32], ptr %a.var, i32 0, i32 0 @@ -76,3 +76,6 @@ fn Run() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/array/function_param.carbon b/toolchain/lower/testdata/array/function_param.carbon index c2fff5de11b8..fd3d9420fd79 100644 --- a/toolchain/lower/testdata/array/function_param.carbon +++ b/toolchain/lower/testdata/array/function_param.carbon @@ -21,14 +21,14 @@ fn G() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: @array.loc16_11.1 = internal constant [3 x i32] [i32 1, i32 2, i32 3] // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F(ptr %arr, i32 %i) { +// CHECK:STDOUT: define i32 @F(ptr %arr, i32 %i) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12_15.2.array.index = getelementptr inbounds [3 x i32], ptr %arr, i32 0, i32 %i // CHECK:STDOUT: %.loc12_15.3 = load i32, ptr %.loc12_15.2.array.index, align 4 // CHECK:STDOUT: ret i32 %.loc12_15.3 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @G() { +// CHECK:STDOUT: define i32 @G() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc16_20.2.temp = alloca [3 x i32], align 4 // CHECK:STDOUT: %.loc16_20.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.2.temp, i32 0, i32 0 @@ -51,3 +51,7 @@ fn G() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/basics/false_true.carbon b/toolchain/lower/testdata/basics/false_true.carbon index 5e726303a822..b08010c9892e 100644 --- a/toolchain/lower/testdata/basics/false_true.carbon +++ b/toolchain/lower/testdata/basics/false_true.carbon @@ -19,12 +19,12 @@ fn T() -> bool { // CHECK:STDOUT: ; ModuleID = 'false_true.carbon' // CHECK:STDOUT: source_filename = "false_true.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @F() { +// CHECK:STDOUT: define i1 @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 false // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @T() { +// CHECK:STDOUT: define i1 @T() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 true // CHECK:STDOUT: } @@ -36,3 +36,7 @@ fn T() -> bool { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "T", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/basics/int_types.carbon b/toolchain/lower/testdata/basics/int_types.carbon index 099a23f66427..79fbefe68955 100644 --- a/toolchain/lower/testdata/basics/int_types.carbon +++ b/toolchain/lower/testdata/basics/int_types.carbon @@ -16,22 +16,22 @@ fn F_u65536(a: u65536) -> u65536 { return a; } // CHECK:STDOUT: ; ModuleID = 'int_types.carbon' // CHECK:STDOUT: source_filename = "int_types.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i8 @F_i8(i8 %a) { +// CHECK:STDOUT: define i8 @F_i8(i8 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i8 %a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i16 @F_u16(i16 %a) { +// CHECK:STDOUT: define i16 @F_u16(i16 %a) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i16 %a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @F_i64(i64 %a) { +// CHECK:STDOUT: define i64 @F_i64(i64 %a) !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i64 %a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i65536 @F_u65536(i65536 %a) { +// CHECK:STDOUT: define i65536 @F_u65536(i65536 %a) !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i65536 %a // CHECK:STDOUT: } @@ -43,3 +43,9 @@ fn F_u65536(a: u65536) -> u65536 { return a; } // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F_i8", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "F_u16", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "F_i64", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "F_u65536", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/basics/numeric_literals.carbon b/toolchain/lower/testdata/basics/numeric_literals.carbon index 1f50d8ac58ac..c95ec0658591 100644 --- a/toolchain/lower/testdata/basics/numeric_literals.carbon +++ b/toolchain/lower/testdata/basics/numeric_literals.carbon @@ -33,7 +33,7 @@ fn F() { // CHECK:STDOUT: @array.1.loc19_4 = internal constant [4 x i32] [i32 8, i32 9, i32 8, i32 8] // CHECK:STDOUT: @array.2.loc27_4 = internal constant [6 x double] [double 9.000000e-01, double 8.000000e+00, double 8.000000e+01, double 1.000000e+07, double 1.000000e+08, double 1.000000e-08] // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() { +// CHECK:STDOUT: define void @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %ints.var = alloca [4 x i32], align 4 // CHECK:STDOUT: %.loc19_3.3.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i32 0 @@ -67,3 +67,6 @@ fn F() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/basics/type_values.carbon b/toolchain/lower/testdata/basics/type_values.carbon index 385fbeaec975..99348a207294 100644 --- a/toolchain/lower/testdata/basics/type_values.carbon +++ b/toolchain/lower/testdata/basics/type_values.carbon @@ -28,17 +28,17 @@ fn F64() -> type { // CHECK:STDOUT: // CHECK:STDOUT: %type = type {} // CHECK:STDOUT: -// CHECK:STDOUT: define %type @I32() { +// CHECK:STDOUT: define %type @I32() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret %type zeroinitializer // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define %type @I48() { +// CHECK:STDOUT: define %type @I48() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret %type zeroinitializer // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define %type @F64() { +// CHECK:STDOUT: define %type @F64() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret %type zeroinitializer // CHECK:STDOUT: } @@ -50,3 +50,8 @@ fn F64() -> type { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "I32", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "I48", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "F64", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/basics/zero.carbon b/toolchain/lower/testdata/basics/zero.carbon index a9f3235c6b3d..eaf8872b2068 100644 --- a/toolchain/lower/testdata/basics/zero.carbon +++ b/toolchain/lower/testdata/basics/zero.carbon @@ -15,7 +15,7 @@ fn Main() -> i32 { // CHECK:STDOUT: ; ModuleID = 'zero.carbon' // CHECK:STDOUT: source_filename = "zero.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Main() { +// CHECK:STDOUT: define i32 @Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } @@ -27,3 +27,6 @@ fn Main() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/builtins/float.carbon b/toolchain/lower/testdata/builtins/float.carbon index 9272cd5f0390..d5ff9fd697c0 100644 --- a/toolchain/lower/testdata/builtins/float.carbon +++ b/toolchain/lower/testdata/builtins/float.carbon @@ -44,67 +44,67 @@ fn TestGreaterEq(a: f64, b: f64) -> bool { return GreaterEq(a, b); } // CHECK:STDOUT: ; ModuleID = 'float.carbon' // CHECK:STDOUT: source_filename = "float.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define double @TestNegate(double %a) { +// CHECK:STDOUT: define double @TestNegate(double %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.negate = fneg double %a // CHECK:STDOUT: ret double %float.negate // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define double @TestAdd(double %a, double %b) { +// CHECK:STDOUT: define double @TestAdd(double %a, double %b) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.add = fadd double %a, %b // CHECK:STDOUT: ret double %float.add // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define double @TestSub(double %a, double %b) { +// CHECK:STDOUT: define double @TestSub(double %a, double %b) !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.sub = fsub double %a, %b // CHECK:STDOUT: ret double %float.sub // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define double @TestMul(double %a, double %b) { +// CHECK:STDOUT: define double @TestMul(double %a, double %b) !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.mul = fmul double %a, %b // CHECK:STDOUT: ret double %float.mul // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define double @TestDiv(double %a, double %b) { +// CHECK:STDOUT: define double @TestDiv(double %a, double %b) !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.div = fdiv double %a, %b // CHECK:STDOUT: ret double %float.div // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestEq(double %a, double %b) { +// CHECK:STDOUT: define i1 @TestEq(double %a, double %b) !dbg !11 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.eq = fcmp oeq double %a, %b // CHECK:STDOUT: ret i1 %float.eq // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestNeq(double %a, double %b) { +// CHECK:STDOUT: define i1 @TestNeq(double %a, double %b) !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.neq = fcmp one double %a, %b // CHECK:STDOUT: ret i1 %float.neq // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestLess(double %a, double %b) { +// CHECK:STDOUT: define i1 @TestLess(double %a, double %b) !dbg !13 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.less = fcmp olt double %a, %b // CHECK:STDOUT: ret i1 %float.less // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestLessEq(double %a, double %b) { +// CHECK:STDOUT: define i1 @TestLessEq(double %a, double %b) !dbg !14 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.less_eq = fcmp ole double %a, %b // CHECK:STDOUT: ret i1 %float.less_eq // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestGreater(double %a, double %b) { +// CHECK:STDOUT: define i1 @TestGreater(double %a, double %b) !dbg !15 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.greater = fcmp ogt double %a, %b // CHECK:STDOUT: ret i1 %float.greater // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestGreaterEq(double %a, double %b) { +// CHECK:STDOUT: define i1 @TestGreaterEq(double %a, double %b) !dbg !16 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.greater_eq = fcmp oge double %a, %b // CHECK:STDOUT: ret i1 %float.greater_eq @@ -117,3 +117,16 @@ fn TestGreaterEq(a: f64, b: f64) -> bool { return GreaterEq(a, b); } // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "TestNegate", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "TestAdd", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "TestSub", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestMul", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "TestDiv", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "TestEq", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "TestNeq", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "TestLess", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "TestLessEq", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "TestGreater", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "TestGreaterEq", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/builtins/int.carbon b/toolchain/lower/testdata/builtins/int.carbon index 6821a5d5657b..6137828468fe 100644 --- a/toolchain/lower/testdata/builtins/int.carbon +++ b/toolchain/lower/testdata/builtins/int.carbon @@ -65,109 +65,109 @@ fn TestGreaterEq(a: i32, b: i32) -> bool { return GreaterEq(a, b); } // CHECK:STDOUT: ; ModuleID = 'int.carbon' // CHECK:STDOUT: source_filename = "int.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestNegate(i32 %a) { +// CHECK:STDOUT: define i32 @TestNegate(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.snegate = sub i32 0, %a // CHECK:STDOUT: ret i32 %int.snegate // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestAdd(i32 %a, i32 %b) { +// CHECK:STDOUT: define i32 @TestAdd(i32 %a, i32 %b) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.sadd = add i32 %a, %b // CHECK:STDOUT: ret i32 %int.sadd // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestSub(i32 %a, i32 %b) { +// CHECK:STDOUT: define i32 @TestSub(i32 %a, i32 %b) !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.ssub = sub i32 %a, %b // CHECK:STDOUT: ret i32 %int.ssub // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestMul(i32 %a, i32 %b) { +// CHECK:STDOUT: define i32 @TestMul(i32 %a, i32 %b) !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.smul = mul i32 %a, %b // CHECK:STDOUT: ret i32 %int.smul // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestDiv(i32 %a, i32 %b) { +// CHECK:STDOUT: define i32 @TestDiv(i32 %a, i32 %b) !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.sdiv = sdiv i32 %a, %b // CHECK:STDOUT: ret i32 %int.sdiv // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestMod(i32 %a, i32 %b) { +// CHECK:STDOUT: define i32 @TestMod(i32 %a, i32 %b) !dbg !11 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.smod = srem i32 %a, %b // CHECK:STDOUT: ret i32 %int.smod // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestComplement(i32 %a) { +// CHECK:STDOUT: define i32 @TestComplement(i32 %a) !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.complement = xor i32 -1, %a // CHECK:STDOUT: ret i32 %int.complement // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestAnd(i32 %a, i32 %b) { +// CHECK:STDOUT: define i32 @TestAnd(i32 %a, i32 %b) !dbg !13 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.and = and i32 %a, %b // CHECK:STDOUT: ret i32 %int.and // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestOr(i32 %a, i32 %b) { +// CHECK:STDOUT: define i32 @TestOr(i32 %a, i32 %b) !dbg !14 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.or = or i32 %a, %b // CHECK:STDOUT: ret i32 %int.or // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestXor(i32 %a, i32 %b) { +// CHECK:STDOUT: define i32 @TestXor(i32 %a, i32 %b) !dbg !15 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.xor = xor i32 %a, %b // CHECK:STDOUT: ret i32 %int.xor // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestLeftShift(i32 %a, i32 %b) { +// CHECK:STDOUT: define i32 @TestLeftShift(i32 %a, i32 %b) !dbg !16 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.left_shift = shl i32 %a, %b // CHECK:STDOUT: ret i32 %int.left_shift // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestRightShift(i32 %a, i32 %b) { +// CHECK:STDOUT: define i32 @TestRightShift(i32 %a, i32 %b) !dbg !17 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.right_shift = ashr i32 %a, %b // CHECK:STDOUT: ret i32 %int.right_shift // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestEq(i32 %a, i32 %b) { +// CHECK:STDOUT: define i1 @TestEq(i32 %a, i32 %b) !dbg !18 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.eq = icmp eq i32 %a, %b // CHECK:STDOUT: ret i1 %int.eq // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestNeq(i32 %a, i32 %b) { +// CHECK:STDOUT: define i1 @TestNeq(i32 %a, i32 %b) !dbg !19 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.neq = icmp ne i32 %a, %b // CHECK:STDOUT: ret i1 %int.neq // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestLess(i32 %a, i32 %b) { +// CHECK:STDOUT: define i1 @TestLess(i32 %a, i32 %b) !dbg !20 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.less = icmp slt i32 %a, %b // CHECK:STDOUT: ret i1 %int.less // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestLessEq(i32 %a, i32 %b) { +// CHECK:STDOUT: define i1 @TestLessEq(i32 %a, i32 %b) !dbg !21 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.less_eq = icmp sle i32 %a, %b // CHECK:STDOUT: ret i1 %int.less_eq // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestGreater(i32 %a, i32 %b) { +// CHECK:STDOUT: define i1 @TestGreater(i32 %a, i32 %b) !dbg !22 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.greater = icmp sgt i32 %a, %b // CHECK:STDOUT: ret i1 %int.greater // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestGreaterEq(i32 %a, i32 %b) { +// CHECK:STDOUT: define i1 @TestGreaterEq(i32 %a, i32 %b) !dbg !23 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.greater_eq = icmp sge i32 %a, %b // CHECK:STDOUT: ret i1 %int.greater_eq @@ -180,3 +180,23 @@ fn TestGreaterEq(a: i32, b: i32) -> bool { return GreaterEq(a, b); } // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "TestNegate", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "TestAdd", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "TestSub", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestMul", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "TestDiv", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "TestMod", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "TestComplement", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "TestAnd", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "TestOr", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "TestXor", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "TestLeftShift", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "TestRightShift", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "TestEq", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "TestNeq", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "TestLess", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "TestLessEq", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "TestGreater", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "TestGreaterEq", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon b/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon index 7a12846df919..bed888cd276c 100644 --- a/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon +++ b/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon @@ -17,13 +17,13 @@ fn TestAddMethod(a: i32, b: i32) -> i32 { return a.(AddMethod)(b); } // CHECK:STDOUT: ; ModuleID = 'method_vs_nonmethod.carbon' // CHECK:STDOUT: source_filename = "method_vs_nonmethod.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestAddNonmethod(i32 %a, i32 %b) { +// CHECK:STDOUT: define i32 @TestAddNonmethod(i32 %a, i32 %b) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.sadd = add i32 %a, %b // CHECK:STDOUT: ret i32 %int.sadd // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestAddMethod(i32 %a, i32 %b) { +// CHECK:STDOUT: define i32 @TestAddMethod(i32 %a, i32 %b) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.sadd = add i32 %a, %b // CHECK:STDOUT: ret i32 %int.sadd @@ -36,3 +36,7 @@ fn TestAddMethod(a: i32, b: i32) -> i32 { return a.(AddMethod)(b); } // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "TestAddNonmethod", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "TestAddMethod", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/builtins/overloaded_operator.carbon b/toolchain/lower/testdata/builtins/overloaded_operator.carbon index 344d6492a952..4c2fb942c9c2 100644 --- a/toolchain/lower/testdata/builtins/overloaded_operator.carbon +++ b/toolchain/lower/testdata/builtins/overloaded_operator.carbon @@ -21,7 +21,7 @@ fn AddThreeIntegers(a: i32, b: i32, c: i32) -> i32 { // CHECK:STDOUT: ; ModuleID = 'overloaded_operator.carbon' // CHECK:STDOUT: source_filename = "overloaded_operator.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @AddThreeIntegers(i32 %a, i32 %b, i32 %c) { +// CHECK:STDOUT: define i32 @AddThreeIntegers(i32 %a, i32 %b, i32 %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.sadd.loc18_12 = add i32 %a, %b // CHECK:STDOUT: %.loc18_12.2.temp = alloca i32, align 4 @@ -38,3 +38,6 @@ fn AddThreeIntegers(a: i32, b: i32, c: i32) -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "AddThreeIntegers", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/builtins/print.carbon b/toolchain/lower/testdata/builtins/print.carbon index 7dfd0270f927..661be7840591 100644 --- a/toolchain/lower/testdata/builtins/print.carbon +++ b/toolchain/lower/testdata/builtins/print.carbon @@ -17,7 +17,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: @printf.int.format = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %print.int.printf = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1) // CHECK:STDOUT: ret void @@ -32,3 +32,6 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/builtins/types.carbon b/toolchain/lower/testdata/builtins/types.carbon index 339dbfd802c9..cab864902251 100644 --- a/toolchain/lower/testdata/builtins/types.carbon +++ b/toolchain/lower/testdata/builtins/types.carbon @@ -21,7 +21,7 @@ fn F() { // CHECK:STDOUT: ; ModuleID = 'types.carbon' // CHECK:STDOUT: source_filename = "types.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() { +// CHECK:STDOUT: define void @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %i.var = alloca i32, align 4 // CHECK:STDOUT: store i32 0, ptr %i.var, align 4 @@ -39,3 +39,6 @@ fn F() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/builtins/uint.carbon b/toolchain/lower/testdata/builtins/uint.carbon index 854d6c4fe2ce..b116815fb13f 100644 --- a/toolchain/lower/testdata/builtins/uint.carbon +++ b/toolchain/lower/testdata/builtins/uint.carbon @@ -65,109 +65,109 @@ fn TestGreaterEq(a: u64, b: u64) -> bool { return GreaterEq(a, b); } // CHECK:STDOUT: ; ModuleID = 'uint.carbon' // CHECK:STDOUT: source_filename = "uint.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestNegate(i64 %a) { +// CHECK:STDOUT: define i64 @TestNegate(i64 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.unegate = sub i64 0, %a // CHECK:STDOUT: ret i64 %int.unegate // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestAdd(i64 %a, i64 %b) { +// CHECK:STDOUT: define i64 @TestAdd(i64 %a, i64 %b) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.uadd = add i64 %a, %b // CHECK:STDOUT: ret i64 %int.uadd // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestSub(i64 %a, i64 %b) { +// CHECK:STDOUT: define i64 @TestSub(i64 %a, i64 %b) !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.usub = sub i64 %a, %b // CHECK:STDOUT: ret i64 %int.usub // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestMul(i64 %a, i64 %b) { +// CHECK:STDOUT: define i64 @TestMul(i64 %a, i64 %b) !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.umul = mul i64 %a, %b // CHECK:STDOUT: ret i64 %int.umul // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestDiv(i64 %a, i64 %b) { +// CHECK:STDOUT: define i64 @TestDiv(i64 %a, i64 %b) !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.udiv = udiv i64 %a, %b // CHECK:STDOUT: ret i64 %int.udiv // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestMod(i64 %a, i64 %b) { +// CHECK:STDOUT: define i64 @TestMod(i64 %a, i64 %b) !dbg !11 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.umod = urem i64 %a, %b // CHECK:STDOUT: ret i64 %int.umod // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestComplement(i64 %a) { +// CHECK:STDOUT: define i64 @TestComplement(i64 %a) !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.complement = xor i64 -1, %a // CHECK:STDOUT: ret i64 %int.complement // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestAnd(i64 %a, i64 %b) { +// CHECK:STDOUT: define i64 @TestAnd(i64 %a, i64 %b) !dbg !13 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.and = and i64 %a, %b // CHECK:STDOUT: ret i64 %int.and // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestOr(i64 %a, i64 %b) { +// CHECK:STDOUT: define i64 @TestOr(i64 %a, i64 %b) !dbg !14 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.or = or i64 %a, %b // CHECK:STDOUT: ret i64 %int.or // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestXor(i64 %a, i64 %b) { +// CHECK:STDOUT: define i64 @TestXor(i64 %a, i64 %b) !dbg !15 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.xor = xor i64 %a, %b // CHECK:STDOUT: ret i64 %int.xor // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestLeftShift(i64 %a, i64 %b) { +// CHECK:STDOUT: define i64 @TestLeftShift(i64 %a, i64 %b) !dbg !16 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.left_shift = shl i64 %a, %b // CHECK:STDOUT: ret i64 %int.left_shift // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestRightShift(i64 %a, i64 %b) { +// CHECK:STDOUT: define i64 @TestRightShift(i64 %a, i64 %b) !dbg !17 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.right_shift = lshr i64 %a, %b // CHECK:STDOUT: ret i64 %int.right_shift // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestEq(i64 %a, i64 %b) { +// CHECK:STDOUT: define i1 @TestEq(i64 %a, i64 %b) !dbg !18 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.eq = icmp eq i64 %a, %b // CHECK:STDOUT: ret i1 %int.eq // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestNeq(i64 %a, i64 %b) { +// CHECK:STDOUT: define i1 @TestNeq(i64 %a, i64 %b) !dbg !19 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.neq = icmp ne i64 %a, %b // CHECK:STDOUT: ret i1 %int.neq // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestLess(i64 %a, i64 %b) { +// CHECK:STDOUT: define i1 @TestLess(i64 %a, i64 %b) !dbg !20 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.less = icmp ult i64 %a, %b // CHECK:STDOUT: ret i1 %int.less // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestLessEq(i64 %a, i64 %b) { +// CHECK:STDOUT: define i1 @TestLessEq(i64 %a, i64 %b) !dbg !21 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.less_eq = icmp ule i64 %a, %b // CHECK:STDOUT: ret i1 %int.less_eq // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestGreater(i64 %a, i64 %b) { +// CHECK:STDOUT: define i1 @TestGreater(i64 %a, i64 %b) !dbg !22 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.greater = icmp ugt i64 %a, %b // CHECK:STDOUT: ret i1 %int.greater // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestGreaterEq(i64 %a, i64 %b) { +// CHECK:STDOUT: define i1 @TestGreaterEq(i64 %a, i64 %b) !dbg !23 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.greater_eq = icmp uge i64 %a, %b // CHECK:STDOUT: ret i1 %int.greater_eq @@ -180,3 +180,23 @@ fn TestGreaterEq(a: u64, b: u64) -> bool { return GreaterEq(a, b); } // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "TestNegate", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "TestAdd", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "TestSub", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestMul", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "TestDiv", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "TestMod", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "TestComplement", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !13 = distinct !DISubprogram(name: "TestAnd", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "TestOr", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "TestXor", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !16 = distinct !DISubprogram(name: "TestLeftShift", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !17 = distinct !DISubprogram(name: "TestRightShift", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "TestEq", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !19 = distinct !DISubprogram(name: "TestNeq", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !20 = distinct !DISubprogram(name: "TestLess", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "TestLessEq", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !22 = distinct !DISubprogram(name: "TestGreater", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !23 = distinct !DISubprogram(name: "TestGreaterEq", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/class/adapt.carbon b/toolchain/lower/testdata/class/adapt.carbon index 4712675af10a..9bdab86bed3c 100644 --- a/toolchain/lower/testdata/class/adapt.carbon +++ b/toolchain/lower/testdata/class/adapt.carbon @@ -56,7 +56,7 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: // CHECK:STDOUT: @struct.loc9_28 = internal constant { i32, i32 } { i32 1, i32 2 } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Make(ptr sret({ i32, i32 }) %return) { +// CHECK:STDOUT: define void @Make(ptr sret({ i32, i32 }) %return) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc9_27.2.a = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0 // CHECK:STDOUT: %.loc9_27.4.b = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1 @@ -64,20 +64,20 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Make.1(ptr sret({ i32, i32 }) %return) { +// CHECK:STDOUT: define void @Make.1(ptr sret({ i32, i32 }) %return) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @Make(ptr %return) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @GetB(ptr %self) { +// CHECK:STDOUT: define i32 @GetB(ptr %self) !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc22_14.1.b = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1 // CHECK:STDOUT: %.loc22_14.2 = load i32, ptr %.loc22_14.1.b, align 4 // CHECK:STDOUT: ret i32 %.loc22_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Use() { +// CHECK:STDOUT: define i32 @Use() !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %pa.var = alloca { i32, i32 }, align 8 // CHECK:STDOUT: call void @Make.1(ptr %pa.var) @@ -97,10 +97,16 @@ fn DoStuff(a: Int) -> Int { // 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: !4 = distinct !DISubprogram(name: "Make", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Make.1", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "GetB", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Use", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: ; ModuleID = 'adapt_int.carbon' // CHECK:STDOUT: source_filename = "adapt_int.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @DoStuff(i32 %a) { +// CHECK:STDOUT: define i32 @DoStuff(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 %a // CHECK:STDOUT: } @@ -112,3 +118,6 @@ fn DoStuff(a: Int) -> Int { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "DoStuff", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/class/base.carbon b/toolchain/lower/testdata/class/base.carbon index 6efb90d24dc7..12fedb69879d 100644 --- a/toolchain/lower/testdata/class/base.carbon +++ b/toolchain/lower/testdata/class/base.carbon @@ -35,7 +35,7 @@ fn Convert(p: Derived*) -> Base* { // CHECK:STDOUT: // CHECK:STDOUT: @struct.2.loc22_36 = internal constant { { i32 }, i32 } { { i32 } { i32 4 }, i32 7 } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Make(ptr sret({ { i32 }, i32 }) %return) { +// CHECK:STDOUT: define void @Make(ptr sret({ { i32 }, i32 }) %return) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc22_35.2.base = getelementptr inbounds nuw { { i32 }, i32 }, ptr %return, i32 0, i32 0 // CHECK:STDOUT: %.loc22_26.2.b = getelementptr inbounds nuw { i32 }, ptr %.loc22_35.2.base, i32 0, i32 0 @@ -44,7 +44,7 @@ fn Convert(p: Derived*) -> Base* { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Access(ptr sret({ i32, i32 }) %return, ptr %d) { +// CHECK:STDOUT: define void @Access(ptr sret({ i32, i32 }) %return, ptr %d) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc26_12.1.d = getelementptr inbounds nuw { { i32 }, i32 }, ptr %d, i32 0, i32 1 // CHECK:STDOUT: %.loc26_12.2 = load i32, ptr %.loc26_12.1.d, align 4 @@ -58,7 +58,7 @@ fn Convert(p: Derived*) -> Base* { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define ptr @Convert(ptr %p) { +// CHECK:STDOUT: define ptr @Convert(ptr %p) !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc30_11.2.base = getelementptr inbounds nuw { { i32 }, i32 }, ptr %p, i32 0, i32 0 // CHECK:STDOUT: ret ptr %.loc30_11.2.base @@ -76,3 +76,8 @@ fn Convert(p: Derived*) -> Base* { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Make", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Access", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Convert", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/class/basic.carbon b/toolchain/lower/testdata/class/basic.carbon index cdf6a8ff9053..32da09ccb2ca 100644 --- a/toolchain/lower/testdata/class/basic.carbon +++ b/toolchain/lower/testdata/class/basic.carbon @@ -25,7 +25,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: declare void @F(ptr sret({ i32, ptr }), ptr) // CHECK:STDOUT: -// CHECK:STDOUT: define void @main() { +// CHECK:STDOUT: define void @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %c.var = alloca { i32, ptr }, align 8 // CHECK:STDOUT: %d.var = alloca { i32, ptr }, align 8 @@ -40,3 +40,6 @@ fn Run() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/class/field.carbon b/toolchain/lower/testdata/class/field.carbon index 1277a47a4cc5..682a0281c566 100644 --- a/toolchain/lower/testdata/class/field.carbon +++ b/toolchain/lower/testdata/class/field.carbon @@ -27,7 +27,7 @@ fn Run() -> i32 { // CHECK:STDOUT: ; ModuleID = 'field.carbon' // CHECK:STDOUT: source_filename = "field.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F(ptr %c) { +// CHECK:STDOUT: define i32 @F(ptr %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc17_13.1.b = getelementptr inbounds nuw { i32, ptr }, ptr %c, i32 0, i32 1 // CHECK:STDOUT: %.loc17_13.2 = load ptr, ptr %.loc17_13.1.b, align 8 @@ -36,7 +36,7 @@ fn Run() -> i32 { // CHECK:STDOUT: ret i32 %.loc17_16.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %c.var = alloca { i32, ptr }, align 8 // CHECK:STDOUT: %.loc22_4.a = getelementptr inbounds nuw { i32, ptr }, ptr %c.var, i32 0, i32 0 @@ -54,3 +54,7 @@ fn Run() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/class/method.carbon b/toolchain/lower/testdata/class/method.carbon index ba7dc13c070e..8d3ef8c60526 100644 --- a/toolchain/lower/testdata/class/method.carbon +++ b/toolchain/lower/testdata/class/method.carbon @@ -27,7 +27,7 @@ fn F(p: C*) { // CHECK:STDOUT: // CHECK:STDOUT: declare void @Set(ptr, i32) // CHECK:STDOUT: -// CHECK:STDOUT: define void @F(ptr %p) { +// CHECK:STDOUT: define void @F(ptr %p) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %Get.call = call i32 @Get(ptr %p) // CHECK:STDOUT: call void @Set(ptr %p, i32 %Get.call) @@ -41,3 +41,6 @@ fn F(p: C*) { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/class/self.carbon b/toolchain/lower/testdata/class/self.carbon index b069cf06afe3..884bf74b4eba 100644 --- a/toolchain/lower/testdata/class/self.carbon +++ b/toolchain/lower/testdata/class/self.carbon @@ -26,14 +26,14 @@ fn C.Set[addr self: C*]() { // CHECK:STDOUT: ; ModuleID = 'self.carbon' // CHECK:STDOUT: source_filename = "self.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Get(ptr %self) { +// CHECK:STDOUT: define i32 @Get(ptr %self) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc19_14.1.a = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: %.loc19_14.2 = load i32, ptr %.loc19_14.1.a, align 4 // CHECK:STDOUT: ret i32 %.loc19_14.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Set(ptr %self) { +// CHECK:STDOUT: define void @Set(ptr %self) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc23_10.a = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: store i32 1, ptr %.loc23_10.a, align 4 @@ -47,3 +47,7 @@ fn C.Set[addr self: C*]() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Get", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Set", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/class/value_access.carbon b/toolchain/lower/testdata/class/value_access.carbon index 3a97d32f5d98..577c10d742d1 100644 --- a/toolchain/lower/testdata/class/value_access.carbon +++ b/toolchain/lower/testdata/class/value_access.carbon @@ -22,7 +22,7 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: ; ModuleID = 'value_access.carbon' // CHECK:STDOUT: source_filename = "value_access.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F(ptr %c) { +// CHECK:STDOUT: define i32 @F(ptr %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc19_11.1.a = getelementptr inbounds nuw { { i32, i32, i32 } }, ptr %c, i32 0, i32 0 // CHECK:STDOUT: %.loc19_11.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc19_11.1.a, i32 0, i32 0 @@ -50,3 +50,6 @@ fn F(c: C) -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/function/call/empty_struct.carbon b/toolchain/lower/testdata/function/call/empty_struct.carbon index ee8cd679501d..b67fa84de447 100644 --- a/toolchain/lower/testdata/function/call/empty_struct.carbon +++ b/toolchain/lower/testdata/function/call/empty_struct.carbon @@ -19,12 +19,12 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'empty_struct.carbon' // CHECK:STDOUT: source_filename = "empty_struct.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Echo() { +// CHECK:STDOUT: define void @Echo() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca {}, align 8 // CHECK:STDOUT: call void @Echo() @@ -38,3 +38,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Echo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/function/call/empty_tuple.carbon b/toolchain/lower/testdata/function/call/empty_tuple.carbon index 1abaae24d568..8876ca2a82cb 100644 --- a/toolchain/lower/testdata/function/call/empty_tuple.carbon +++ b/toolchain/lower/testdata/function/call/empty_tuple.carbon @@ -19,12 +19,12 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'empty_tuple.carbon' // CHECK:STDOUT: source_filename = "empty_tuple.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Echo() { +// CHECK:STDOUT: define void @Echo() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca {}, align 8 // CHECK:STDOUT: call void @Echo() @@ -38,3 +38,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Echo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/function/call/i32.carbon b/toolchain/lower/testdata/function/call/i32.carbon index 2e29e6673998..a58499a269cf 100644 --- a/toolchain/lower/testdata/function/call/i32.carbon +++ b/toolchain/lower/testdata/function/call/i32.carbon @@ -19,12 +19,12 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'i32.carbon' // CHECK:STDOUT: source_filename = "i32.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Echo(i32 %a) { +// CHECK:STDOUT: define i32 @Echo(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 %a // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca i32, align 4 // CHECK:STDOUT: %Echo.call = call i32 @Echo(i32 1) @@ -39,3 +39,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Echo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) 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 58325fb8bc10..8593c5034891 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 @@ -20,17 +20,17 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'implicit_empty_tuple_as_arg.carbon' // CHECK:STDOUT: source_filename = "implicit_empty_tuple_as_arg.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Foo() { +// CHECK:STDOUT: define void @Foo() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Bar() { +// CHECK:STDOUT: define void @Bar() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca {}, align 8 // CHECK:STDOUT: call void @Foo() @@ -46,3 +46,8 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Bar", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/function/call/params_one.carbon b/toolchain/lower/testdata/function/call/params_one.carbon index 9e1852697a90..1ea9d5ebf1b8 100644 --- a/toolchain/lower/testdata/function/call/params_one.carbon +++ b/toolchain/lower/testdata/function/call/params_one.carbon @@ -17,12 +17,12 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'params_one.carbon' // CHECK:STDOUT: source_filename = "params_one.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Foo(i32 %a) { +// CHECK:STDOUT: define void @Foo(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @Foo(i32 1) // CHECK:STDOUT: ret void @@ -35,3 +35,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/function/call/params_one_comma.carbon b/toolchain/lower/testdata/function/call/params_one_comma.carbon index 8431533d4780..c4662c81fa79 100644 --- a/toolchain/lower/testdata/function/call/params_one_comma.carbon +++ b/toolchain/lower/testdata/function/call/params_one_comma.carbon @@ -18,12 +18,12 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'params_one_comma.carbon' // CHECK:STDOUT: source_filename = "params_one_comma.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Foo(i32 %a) { +// CHECK:STDOUT: define void @Foo(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @Foo(i32 1) // CHECK:STDOUT: call void @Foo(i32 1) @@ -37,3 +37,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/function/call/params_two.carbon b/toolchain/lower/testdata/function/call/params_two.carbon index 343414bf62b0..bf327a228cea 100644 --- a/toolchain/lower/testdata/function/call/params_two.carbon +++ b/toolchain/lower/testdata/function/call/params_two.carbon @@ -17,12 +17,12 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'params_two.carbon' // CHECK:STDOUT: source_filename = "params_two.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Foo(i32 %a, i32 %b) { +// CHECK:STDOUT: define void @Foo(i32 %a, i32 %b) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @Foo(i32 1, i32 2) // CHECK:STDOUT: ret void @@ -35,3 +35,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/function/call/params_two_comma.carbon b/toolchain/lower/testdata/function/call/params_two_comma.carbon index ce82f627039d..8c9370c24eec 100644 --- a/toolchain/lower/testdata/function/call/params_two_comma.carbon +++ b/toolchain/lower/testdata/function/call/params_two_comma.carbon @@ -18,12 +18,12 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'params_two_comma.carbon' // CHECK:STDOUT: source_filename = "params_two_comma.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Foo(i32 %a, i32 %b) { +// CHECK:STDOUT: define void @Foo(i32 %a, i32 %b) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @Foo(i32 1, i32 2) // CHECK:STDOUT: call void @Foo(i32 1, i32 2) @@ -37,3 +37,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/function/call/params_zero.carbon b/toolchain/lower/testdata/function/call/params_zero.carbon index 3f1e052b5c49..a8c74559c9aa 100644 --- a/toolchain/lower/testdata/function/call/params_zero.carbon +++ b/toolchain/lower/testdata/function/call/params_zero.carbon @@ -17,12 +17,12 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'params_zero.carbon' // CHECK:STDOUT: source_filename = "params_zero.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Foo() { +// CHECK:STDOUT: define void @Foo() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @Foo() // CHECK:STDOUT: ret void @@ -35,3 +35,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/function/call/return_implicit.carbon b/toolchain/lower/testdata/function/call/return_implicit.carbon index 61682273d0e3..208425849676 100644 --- a/toolchain/lower/testdata/function/call/return_implicit.carbon +++ b/toolchain/lower/testdata/function/call/return_implicit.carbon @@ -19,12 +19,12 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'return_implicit.carbon' // CHECK:STDOUT: source_filename = "return_implicit.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @MakeImplicitEmptyTuple() { +// CHECK:STDOUT: define void @MakeImplicitEmptyTuple() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca {}, align 8 // CHECK:STDOUT: call void @MakeImplicitEmptyTuple() @@ -38,3 +38,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "MakeImplicitEmptyTuple", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/function/call/struct_param.carbon b/toolchain/lower/testdata/function/call/struct_param.carbon index f184dc850485..82670b16e1f6 100644 --- a/toolchain/lower/testdata/function/call/struct_param.carbon +++ b/toolchain/lower/testdata/function/call/struct_param.carbon @@ -19,12 +19,12 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: @struct.3.loc14_4.3 = internal constant { i32, i32 } { i32 2, i32 3 } // CHECK:STDOUT: -// CHECK:STDOUT: define void @F({ i32 } %b, ptr %c) { +// CHECK:STDOUT: define void @F({ i32 } %b, ptr %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @F({ i32 } { i32 1 }, ptr @struct.3.loc14_4.3) // CHECK:STDOUT: ret void @@ -37,3 +37,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/function/call/tuple_param.carbon b/toolchain/lower/testdata/function/call/tuple_param.carbon index f155cef1f001..25adaaa95709 100644 --- a/toolchain/lower/testdata/function/call/tuple_param.carbon +++ b/toolchain/lower/testdata/function/call/tuple_param.carbon @@ -19,12 +19,12 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: @tuple.3.loc14_4.3 = internal constant { i32, i32 } { i32 2, i32 3 } // CHECK:STDOUT: -// CHECK:STDOUT: define void @F({ i32 } %b, ptr %c) { +// CHECK:STDOUT: define void @F({ i32 } %b, ptr %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @F({ i32 } { i32 1 }, ptr @tuple.3.loc14_4.3) // CHECK:STDOUT: ret void @@ -37,3 +37,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) 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 d00e90501acb..b13289cfcdf1 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 @@ -21,7 +21,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: @tuple.3.loc16_4.4 = internal constant { i32, i32 } { i32 2, i32 3 } // CHECK:STDOUT: -// CHECK:STDOUT: define void @F(ptr sret({ i32, i32, i32 }) %return, { i32 } %b, ptr %c) { +// CHECK:STDOUT: define void @F(ptr sret({ i32, i32, i32 }) %return, { i32 } %b, ptr %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12_12.tuple.index = extractvalue { i32 } %b, 0 // CHECK:STDOUT: %.loc12_17.tuple.index = getelementptr inbounds nuw { i32, i32 }, ptr %c, i32 0, i32 0 @@ -37,7 +37,7 @@ fn Main() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc16_4.1.temp = alloca { i32, i32, i32 }, align 8 // CHECK:STDOUT: call void @F(ptr %.loc16_4.1.temp, { i32 } { i32 1 }, ptr @tuple.3.loc16_4.4) @@ -54,3 +54,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/function/call/var_param.carbon b/toolchain/lower/testdata/function/call/var_param.carbon index 6c5a606836c1..80900efff8ea 100644 --- a/toolchain/lower/testdata/function/call/var_param.carbon +++ b/toolchain/lower/testdata/function/call/var_param.carbon @@ -18,12 +18,12 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'var_param.carbon' // CHECK:STDOUT: source_filename = "var_param.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @DoNothing(i32 %a) { +// CHECK:STDOUT: define void @DoNothing(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca i32, align 4 // CHECK:STDOUT: store i32 0, ptr %a.var, align 4 @@ -39,3 +39,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "DoNothing", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/function/declaration/simple.carbon b/toolchain/lower/testdata/function/declaration/simple.carbon index 8d87441bccd9..07a1a36acea7 100644 --- a/toolchain/lower/testdata/function/declaration/simple.carbon +++ b/toolchain/lower/testdata/function/declaration/simple.carbon @@ -17,7 +17,7 @@ fn G(n: i32) { F(n); } // CHECK:STDOUT: // CHECK:STDOUT: declare void @F(i32) // CHECK:STDOUT: -// CHECK:STDOUT: define void @G(i32 %n) { +// CHECK:STDOUT: define void @G(i32 %n) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @F(i32 %n) // CHECK:STDOUT: ret void @@ -30,3 +30,6 @@ fn G(n: i32) { F(n); } // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/function/definition/empty_struct.carbon b/toolchain/lower/testdata/function/definition/empty_struct.carbon index f2485ef74fee..2118a3f52f2f 100644 --- a/toolchain/lower/testdata/function/definition/empty_struct.carbon +++ b/toolchain/lower/testdata/function/definition/empty_struct.carbon @@ -14,7 +14,7 @@ fn Echo(a: {}) { // CHECK:STDOUT: ; ModuleID = 'empty_struct.carbon' // CHECK:STDOUT: source_filename = "empty_struct.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Echo() { +// CHECK:STDOUT: define void @Echo() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -26,3 +26,6 @@ fn Echo(a: {}) { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Echo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/function/definition/params_one.carbon b/toolchain/lower/testdata/function/definition/params_one.carbon index c5e6f8ff4eab..4e0db07d4f1c 100644 --- a/toolchain/lower/testdata/function/definition/params_one.carbon +++ b/toolchain/lower/testdata/function/definition/params_one.carbon @@ -13,7 +13,7 @@ fn Foo(a: i32) {} // CHECK:STDOUT: ; ModuleID = 'params_one.carbon' // CHECK:STDOUT: source_filename = "params_one.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Foo(i32 %a) { +// CHECK:STDOUT: define void @Foo(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -25,3 +25,6 @@ fn Foo(a: i32) {} // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/function/definition/params_two.carbon b/toolchain/lower/testdata/function/definition/params_two.carbon index 37d197109cd9..d3da45bc4550 100644 --- a/toolchain/lower/testdata/function/definition/params_two.carbon +++ b/toolchain/lower/testdata/function/definition/params_two.carbon @@ -13,7 +13,7 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: ; ModuleID = 'params_two.carbon' // CHECK:STDOUT: source_filename = "params_two.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Foo(i32 %a, i32 %b) { +// CHECK:STDOUT: define void @Foo(i32 %a, i32 %b) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -25,3 +25,6 @@ fn Foo(a: i32, b: i32) {} // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/function/definition/params_zero.carbon b/toolchain/lower/testdata/function/definition/params_zero.carbon index 226215750df4..543df1b9dc0f 100644 --- a/toolchain/lower/testdata/function/definition/params_zero.carbon +++ b/toolchain/lower/testdata/function/definition/params_zero.carbon @@ -13,7 +13,7 @@ fn Foo() {} // CHECK:STDOUT: ; ModuleID = 'params_zero.carbon' // CHECK:STDOUT: source_filename = "params_zero.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Foo() { +// CHECK:STDOUT: define void @Foo() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -25,3 +25,6 @@ fn Foo() {} // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/global/class_obj.carbon b/toolchain/lower/testdata/global/class_obj.carbon index c3d8b99a946a..a510361c79ae 100644 --- a/toolchain/lower/testdata/global/class_obj.carbon +++ b/toolchain/lower/testdata/global/class_obj.carbon @@ -18,7 +18,7 @@ var a: A = {}; // CHECK:STDOUT: @struct.loc12_14 = internal constant {} zeroinitializer // CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__global_init, ptr null }] // CHECK:STDOUT: -// CHECK:STDOUT: define void @__global_init() { +// CHECK:STDOUT: define void @__global_init() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 @a, ptr align 1 @struct.loc12_14, i64 0, i1 false) // CHECK:STDOUT: ret void @@ -36,3 +36,6 @@ var a: A = {}; // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "__global_init", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/global/class_with_fun.carbon b/toolchain/lower/testdata/global/class_with_fun.carbon index e8b1a82317ff..3409f7c9483d 100644 --- a/toolchain/lower/testdata/global/class_with_fun.carbon +++ b/toolchain/lower/testdata/global/class_with_fun.carbon @@ -23,13 +23,13 @@ var a: A = {}; // CHECK:STDOUT: @struct.loc16_14 = internal constant {} zeroinitializer // CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__global_init, ptr null }] // CHECK:STDOUT: -// CHECK:STDOUT: define void @ret_a(ptr sret({}) %return) { +// CHECK:STDOUT: define void @ret_a(ptr sret({}) %return) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %return, ptr align 1 @struct.loc13_12, i64 0, i1 false) // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @__global_init() { +// CHECK:STDOUT: define void @__global_init() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 @a, ptr align 1 @struct.loc16_14, i64 0, i1 false) // CHECK:STDOUT: ret void @@ -50,3 +50,7 @@ var a: A = {}; // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "ret_a", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "__global_init", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/global/simple_init.carbon b/toolchain/lower/testdata/global/simple_init.carbon index 6425273ea606..5ff08b9d743c 100644 --- a/toolchain/lower/testdata/global/simple_init.carbon +++ b/toolchain/lower/testdata/global/simple_init.carbon @@ -15,7 +15,7 @@ var a: i32 = 0; // CHECK:STDOUT: @a = internal global i32 // CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__global_init, ptr null }] // CHECK:STDOUT: -// CHECK:STDOUT: define void @__global_init() { +// CHECK:STDOUT: define void @__global_init() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: store i32 0, ptr @a, align 4 // CHECK:STDOUT: ret void @@ -31,3 +31,6 @@ var a: i32 = 0; // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "__global_init", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/global/simple_with_fun.carbon b/toolchain/lower/testdata/global/simple_with_fun.carbon index 5e988e81a934..981b5a05ba92 100644 --- a/toolchain/lower/testdata/global/simple_with_fun.carbon +++ b/toolchain/lower/testdata/global/simple_with_fun.carbon @@ -20,12 +20,12 @@ var a: i32 = test_a(); // CHECK:STDOUT: @a = internal global i32 // CHECK:STDOUT: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__global_init, ptr null }] // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @test_a() { +// CHECK:STDOUT: define i32 @test_a() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @__global_init() { +// CHECK:STDOUT: define void @__global_init() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %test_a.call = call i32 @test_a() // CHECK:STDOUT: store i32 %test_a.call, ptr @a, align 4 @@ -42,3 +42,7 @@ var a: i32 = test_a(); // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "test_a", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "__global_init", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/if/else.carbon b/toolchain/lower/testdata/if/else.carbon index a32ef445aa2f..1f3060320d87 100644 --- a/toolchain/lower/testdata/if/else.carbon +++ b/toolchain/lower/testdata/if/else.carbon @@ -24,22 +24,22 @@ fn If(b: bool) { // CHECK:STDOUT: ; ModuleID = 'else.carbon' // CHECK:STDOUT: source_filename = "else.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() { +// CHECK:STDOUT: define void @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() { +// CHECK:STDOUT: define void @G() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @H() { +// CHECK:STDOUT: define void @H() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @If(i1 %b) { +// CHECK:STDOUT: define void @If(i1 %b) !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br i1 %b, label %if.then, label %if.else // CHECK:STDOUT: @@ -63,3 +63,9 @@ fn If(b: bool) { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "H", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "If", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/if/no_else.carbon b/toolchain/lower/testdata/if/no_else.carbon index 6e980c989527..d3853aba88eb 100644 --- a/toolchain/lower/testdata/if/no_else.carbon +++ b/toolchain/lower/testdata/if/no_else.carbon @@ -21,17 +21,17 @@ fn If(b: bool) { // CHECK:STDOUT: ; ModuleID = 'no_else.carbon' // CHECK:STDOUT: source_filename = "no_else.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() { +// CHECK:STDOUT: define void @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() { +// CHECK:STDOUT: define void @G() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @If(i1 %b) { +// CHECK:STDOUT: define void @If(i1 %b) !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br i1 %b, label %if.then, label %if.else // CHECK:STDOUT: @@ -51,3 +51,8 @@ fn If(b: bool) { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "If", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/if_expr/basic.carbon b/toolchain/lower/testdata/if_expr/basic.carbon index 635525b59f8d..bb731f22779a 100644 --- a/toolchain/lower/testdata/if_expr/basic.carbon +++ b/toolchain/lower/testdata/if_expr/basic.carbon @@ -18,17 +18,17 @@ fn Select(b: bool) -> i32 { // CHECK:STDOUT: ; ModuleID = 'basic.carbon' // CHECK:STDOUT: source_filename = "basic.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F() { +// CHECK:STDOUT: define i32 @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 1 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @G() { +// CHECK:STDOUT: define i32 @G() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Select(i1 %b) { +// CHECK:STDOUT: define i32 @Select(i1 %b) !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br i1 %b, label %if.expr.then, label %if.expr.else // CHECK:STDOUT: @@ -52,3 +52,8 @@ fn Select(b: bool) -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Select", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/if_expr/empty_block.carbon b/toolchain/lower/testdata/if_expr/empty_block.carbon index 332990f17452..14c9a2214482 100644 --- a/toolchain/lower/testdata/if_expr/empty_block.carbon +++ b/toolchain/lower/testdata/if_expr/empty_block.carbon @@ -15,7 +15,7 @@ fn Select(b: bool, c: bool, d: bool) -> i32 { // CHECK:STDOUT: ; ModuleID = 'empty_block.carbon' // CHECK:STDOUT: source_filename = "empty_block.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Select(i1 %b, i1 %c, i1 %d) { +// CHECK:STDOUT: define i32 @Select(i1 %b, i1 %c, i1 %d) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br i1 %b, label %if.expr.then.loc12_10, label %if.expr.else.loc12_10 // CHECK:STDOUT: @@ -57,3 +57,6 @@ fn Select(b: bool, c: bool, d: bool) -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Select", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/impl/assoc_fn_alias.carbon b/toolchain/lower/testdata/impl/assoc_fn_alias.carbon index a1579b954f19..05854e7d29b2 100644 --- a/toolchain/lower/testdata/impl/assoc_fn_alias.carbon +++ b/toolchain/lower/testdata/impl/assoc_fn_alias.carbon @@ -30,14 +30,14 @@ fn Call(a: A) -> i32 { // CHECK:STDOUT: ; ModuleID = 'assoc_fn_alias.carbon' // CHECK:STDOUT: source_filename = "assoc_fn_alias.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F(ptr %self) { +// CHECK:STDOUT: define i32 @F(ptr %self) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc22_16.1.n = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: %.loc22_16.2 = load i32, ptr %.loc22_16.1.n, align 4 // CHECK:STDOUT: ret i32 %.loc22_16.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Call(ptr %a) { +// CHECK:STDOUT: define i32 @Call(ptr %a) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %F.call = call i32 @F(ptr %a) // CHECK:STDOUT: ret i32 %F.call @@ -50,3 +50,7 @@ fn Call(a: A) -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/impl/extend_impl.carbon b/toolchain/lower/testdata/impl/extend_impl.carbon index c0592d69f686..91664055b5c1 100644 --- a/toolchain/lower/testdata/impl/extend_impl.carbon +++ b/toolchain/lower/testdata/impl/extend_impl.carbon @@ -31,18 +31,18 @@ fn InstanceAccess(a: A) -> i32 { // CHECK:STDOUT: ; ModuleID = 'extend_impl.carbon' // CHECK:STDOUT: source_filename = "extend_impl.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F() { +// CHECK:STDOUT: define i32 @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TypeAccess() { +// CHECK:STDOUT: define i32 @TypeAccess() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %F.call = call i32 @F() // CHECK:STDOUT: ret i32 %F.call // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @InstanceAccess(ptr %a) { +// CHECK:STDOUT: define i32 @InstanceAccess(ptr %a) !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %F.call = call i32 @F() // CHECK:STDOUT: ret i32 %F.call @@ -55,3 +55,8 @@ fn InstanceAccess(a: A) -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "TypeAccess", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "InstanceAccess", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/impl/impl.carbon b/toolchain/lower/testdata/impl/impl.carbon index 116106279e10..ab92e36a30e4 100644 --- a/toolchain/lower/testdata/impl/impl.carbon +++ b/toolchain/lower/testdata/impl/impl.carbon @@ -29,14 +29,14 @@ fn Call(a: A) -> i32 { // CHECK:STDOUT: ; ModuleID = 'impl.carbon' // CHECK:STDOUT: source_filename = "impl.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F(ptr %self) { +// CHECK:STDOUT: define i32 @F(ptr %self) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc21_16.1.n = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: %.loc21_16.2 = load i32, ptr %.loc21_16.1.n, align 4 // CHECK:STDOUT: ret i32 %.loc21_16.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Call(ptr %a) { +// CHECK:STDOUT: define i32 @Call(ptr %a) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %F.call = call i32 @F(ptr %a) // CHECK:STDOUT: ret i32 %F.call @@ -49,3 +49,7 @@ fn Call(a: A) -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/impl/instance_method.carbon b/toolchain/lower/testdata/impl/instance_method.carbon index 88000ebe8e45..a8352301213c 100644 --- a/toolchain/lower/testdata/impl/instance_method.carbon +++ b/toolchain/lower/testdata/impl/instance_method.carbon @@ -29,12 +29,12 @@ fn Call(a: A*) -> A* { // CHECK:STDOUT: ; ModuleID = 'instance_method.carbon' // CHECK:STDOUT: source_filename = "instance_method.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define ptr @Get(ptr %self) { +// CHECK:STDOUT: define ptr @Get(ptr %self) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret ptr %self // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define ptr @Call(ptr %a) { +// CHECK:STDOUT: define ptr @Call(ptr %a) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %Get.call = call ptr @Get(ptr %a) // CHECK:STDOUT: ret ptr %Get.call @@ -47,3 +47,7 @@ fn Call(a: A*) -> A* { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Get", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/index/array_element_access.carbon b/toolchain/lower/testdata/index/array_element_access.carbon index 570f6965892b..e0008477daf0 100644 --- a/toolchain/lower/testdata/index/array_element_access.carbon +++ b/toolchain/lower/testdata/index/array_element_access.carbon @@ -24,7 +24,7 @@ fn Run() { // CHECK:STDOUT: @tuple.loc10_37 = internal constant { i32, i32 } { i32 1, i32 2 } // CHECK:STDOUT: @array.loc12_35 = internal constant [2 x i32] [i32 1, i32 2] // CHECK:STDOUT: -// CHECK:STDOUT: define void @A(ptr sret({ i32, i32 }) %return) { +// CHECK:STDOUT: define void @A(ptr sret({ i32, i32 }) %return) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc10_36.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0 // CHECK:STDOUT: %.loc10_36.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1 @@ -32,7 +32,7 @@ fn Run() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @B(ptr sret([2 x i32]) %return) { +// CHECK:STDOUT: define void @B(ptr sret([2 x i32]) %return) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12_34.3.array.index = getelementptr inbounds [2 x i32], ptr %return, i32 0, i32 0 // CHECK:STDOUT: %.loc12_34.6.array.index = getelementptr inbounds [2 x i32], ptr %return, i32 0, i32 1 @@ -40,7 +40,7 @@ fn Run() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @main() { +// CHECK:STDOUT: define void @main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca [2 x i32], align 4 // CHECK:STDOUT: %.loc15_22.1.temp = alloca { i32, i32 }, align 8 @@ -84,3 +84,8 @@ fn Run() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "A", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "B", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/interface/assoc.carbon b/toolchain/lower/testdata/interface/assoc.carbon index 5bed23d53e93..2964c91d8662 100644 --- a/toolchain/lower/testdata/interface/assoc.carbon +++ b/toolchain/lower/testdata/interface/assoc.carbon @@ -17,7 +17,7 @@ fn F() { I.Assoc; } // CHECK:STDOUT: ; ModuleID = 'assoc.carbon' // CHECK:STDOUT: source_filename = "assoc.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() { +// CHECK:STDOUT: define void @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -29,3 +29,6 @@ fn F() { I.Assoc; } // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/interface/basic.carbon b/toolchain/lower/testdata/interface/basic.carbon index ac9a3fccb3ee..3ec7b326dbce 100644 --- a/toolchain/lower/testdata/interface/basic.carbon +++ b/toolchain/lower/testdata/interface/basic.carbon @@ -24,12 +24,12 @@ fn G(T: J) {} // CHECK:STDOUT: ; ModuleID = 'basic.carbon' // CHECK:STDOUT: source_filename = "basic.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() { +// CHECK:STDOUT: define void @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() { +// CHECK:STDOUT: define void @G() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -41,3 +41,7 @@ fn G(T: J) {} // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/let/local.carbon b/toolchain/lower/testdata/let/local.carbon index fbd996d852be..327a2c36f583 100644 --- a/toolchain/lower/testdata/let/local.carbon +++ b/toolchain/lower/testdata/let/local.carbon @@ -17,7 +17,7 @@ fn Run() -> i32 { // CHECK:STDOUT: ; ModuleID = 'local.carbon' // CHECK:STDOUT: source_filename = "local.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 1 // CHECK:STDOUT: } @@ -29,3 +29,6 @@ fn Run() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/let/tuple.carbon b/toolchain/lower/testdata/let/tuple.carbon index 8bcf83b2e639..a47f3047c97e 100644 --- a/toolchain/lower/testdata/let/tuple.carbon +++ b/toolchain/lower/testdata/let/tuple.carbon @@ -21,7 +21,7 @@ fn F() -> i32 { // CHECK:STDOUT: @tuple.1.loc12_37 = internal constant { i32, i32, i32 } { i32 1, i32 2, i32 3 } // CHECK:STDOUT: @tuple.2.loc13_29 = internal constant { i32, i32 } { i32 4, i32 5 } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F() { +// CHECK:STDOUT: define i32 @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8 // CHECK:STDOUT: %.loc12_36.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0 @@ -81,3 +81,6 @@ fn F() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/namespace/function.carbon b/toolchain/lower/testdata/namespace/function.carbon index f022c188de3d..66fd08165fc6 100644 --- a/toolchain/lower/testdata/namespace/function.carbon +++ b/toolchain/lower/testdata/namespace/function.carbon @@ -24,17 +24,17 @@ fn Bar() { // CHECK:STDOUT: ; ModuleID = 'function.carbon' // CHECK:STDOUT: source_filename = "function.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Baz() { +// CHECK:STDOUT: define void @Baz() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Baz.1() { +// CHECK:STDOUT: define void @Baz.1() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Bar() { +// CHECK:STDOUT: define void @Bar() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @Baz.1() // CHECK:STDOUT: ret void @@ -47,3 +47,8 @@ fn Bar() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Baz", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Baz.1", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Bar", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/namespace/nested.carbon b/toolchain/lower/testdata/namespace/nested.carbon index 198ef5e13fd9..081911d42885 100644 --- a/toolchain/lower/testdata/namespace/nested.carbon +++ b/toolchain/lower/testdata/namespace/nested.carbon @@ -21,12 +21,12 @@ fn Foo.Bar.Baz() { // CHECK:STDOUT: ; ModuleID = 'nested.carbon' // CHECK:STDOUT: source_filename = "nested.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Wiz() { +// CHECK:STDOUT: define void @Wiz() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Baz() { +// CHECK:STDOUT: define void @Baz() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @Wiz() // CHECK:STDOUT: ret void @@ -39,3 +39,7 @@ fn Foo.Bar.Baz() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Wiz", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Baz", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/operators/and.carbon b/toolchain/lower/testdata/operators/and.carbon index 18de3b877cf0..3951608556b0 100644 --- a/toolchain/lower/testdata/operators/and.carbon +++ b/toolchain/lower/testdata/operators/and.carbon @@ -18,17 +18,17 @@ fn And() -> bool { // CHECK:STDOUT: ; ModuleID = 'and.carbon' // CHECK:STDOUT: source_filename = "and.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @F() { +// CHECK:STDOUT: define i1 @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 true // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @G() { +// CHECK:STDOUT: define i1 @G() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 true // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @And() { +// CHECK:STDOUT: define i1 @And() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %F.call = call i1 @F() // CHECK:STDOUT: br i1 %F.call, label %and.rhs, label %and.result @@ -49,3 +49,8 @@ fn And() -> bool { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "And", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/operators/and_empty_block.carbon b/toolchain/lower/testdata/operators/and_empty_block.carbon index f8a2aeaebb20..16686efcfd0d 100644 --- a/toolchain/lower/testdata/operators/and_empty_block.carbon +++ b/toolchain/lower/testdata/operators/and_empty_block.carbon @@ -17,7 +17,7 @@ fn And(b: bool, c: bool) -> bool { // CHECK:STDOUT: ; ModuleID = 'and_empty_block.carbon' // CHECK:STDOUT: source_filename = "and_empty_block.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @And(i1 %b, i1 %c) { +// CHECK:STDOUT: define i1 @And(i1 %b, i1 %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br i1 %b, label %and.rhs, label %and.result // CHECK:STDOUT: @@ -36,3 +36,6 @@ fn And(b: bool, c: bool) -> bool { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "And", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/operators/assignment.carbon b/toolchain/lower/testdata/operators/assignment.carbon index 7bfe57893041..ab15db20a731 100644 --- a/toolchain/lower/testdata/operators/assignment.carbon +++ b/toolchain/lower/testdata/operators/assignment.carbon @@ -20,7 +20,7 @@ fn Main() { // CHECK:STDOUT: // CHECK:STDOUT: @tuple.loc15_5 = internal constant { i32, i32 } { i32 1, i32 2 } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca i32, align 4 // CHECK:STDOUT: store i32 12, ptr %a.var, align 4 @@ -44,3 +44,6 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/operators/not.carbon b/toolchain/lower/testdata/operators/not.carbon index e94d24701f51..ec55d60e2d03 100644 --- a/toolchain/lower/testdata/operators/not.carbon +++ b/toolchain/lower/testdata/operators/not.carbon @@ -15,7 +15,7 @@ fn Not(b: bool) -> bool { // CHECK:STDOUT: ; ModuleID = 'not.carbon' // CHECK:STDOUT: source_filename = "not.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @Not(i1 %b) { +// CHECK:STDOUT: define i1 @Not(i1 %b) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12 = xor i1 %b, true // CHECK:STDOUT: ret i1 %.loc12 @@ -28,3 +28,6 @@ fn Not(b: bool) -> bool { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Not", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/operators/or.carbon b/toolchain/lower/testdata/operators/or.carbon index a045daa2d837..a5a4b5bbfa14 100644 --- a/toolchain/lower/testdata/operators/or.carbon +++ b/toolchain/lower/testdata/operators/or.carbon @@ -18,17 +18,17 @@ fn Or() -> bool { // CHECK:STDOUT: ; ModuleID = 'or.carbon' // CHECK:STDOUT: source_filename = "or.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @F() { +// CHECK:STDOUT: define i1 @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 true // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @G() { +// CHECK:STDOUT: define i1 @G() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 true // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @Or() { +// CHECK:STDOUT: define i1 @Or() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %F.call = call i1 @F() // CHECK:STDOUT: %.loc15_14.3 = xor i1 %F.call, true @@ -50,3 +50,8 @@ fn Or() -> bool { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Or", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/operators/or_empty_block.carbon b/toolchain/lower/testdata/operators/or_empty_block.carbon index ee50df2e569d..c4f5c6e87917 100644 --- a/toolchain/lower/testdata/operators/or_empty_block.carbon +++ b/toolchain/lower/testdata/operators/or_empty_block.carbon @@ -17,7 +17,7 @@ fn Or(b: bool, c: bool) -> bool { // CHECK:STDOUT: ; ModuleID = 'or_empty_block.carbon' // CHECK:STDOUT: source_filename = "or_empty_block.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @Or(i1 %b, i1 %c) { +// CHECK:STDOUT: define i1 @Or(i1 %b, i1 %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc14_12.1 = xor i1 %b, true // CHECK:STDOUT: br i1 %.loc14_12.1, label %or.rhs, label %or.result @@ -37,3 +37,6 @@ fn Or(b: bool, c: bool) -> bool { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Or", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/operators/overloaded.carbon b/toolchain/lower/testdata/operators/overloaded.carbon index cc3a82d804e8..0279cf12922b 100644 --- a/toolchain/lower/testdata/operators/overloaded.carbon +++ b/toolchain/lower/testdata/operators/overloaded.carbon @@ -31,7 +31,7 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: ; ModuleID = 'overloaded.carbon' // CHECK:STDOUT: source_filename = "overloaded.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Op(ptr sret({ i1 }) %return, ptr %self) { +// CHECK:STDOUT: define void @Op(ptr sret({ i1 }) %return, ptr %self) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc17_36.1.is_positive = getelementptr inbounds nuw { i1 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: %.loc17_36.2 = load i1, ptr %.loc17_36.1.is_positive, align 1 @@ -41,7 +41,7 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Op.1(ptr sret({ i1 }) %return, ptr %self, ptr %other) { +// CHECK:STDOUT: define void @Op.1(ptr sret({ i1 }) %return, ptr %self, ptr %other) !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc22_33.1.is_positive = getelementptr inbounds nuw { i1 }, ptr %self, i32 0, i32 0 // CHECK:STDOUT: %.loc22_33.2 = load i1, ptr %.loc22_33.1.is_positive, align 1 @@ -80,7 +80,7 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Calculate(ptr sret({ i1 }) %return, ptr %a, ptr %b) { +// CHECK:STDOUT: define void @Calculate(ptr sret({ i1 }) %return, ptr %a, ptr %b) !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc28_10.2.temp = alloca { i1 }, align 8 // CHECK:STDOUT: call void @Op(ptr %.loc28_10.2.temp, ptr %a) @@ -98,3 +98,8 @@ fn Calculate(a: Number, b: Number) -> Number { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Op", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Op.1", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Calculate", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/packages/cross_package_call.carbon b/toolchain/lower/testdata/packages/cross_package_call.carbon index 11960438b016..677faae0e42a 100644 --- a/toolchain/lower/testdata/packages/cross_package_call.carbon +++ b/toolchain/lower/testdata/packages/cross_package_call.carbon @@ -23,7 +23,7 @@ fn G() { A.F(); } // CHECK:STDOUT: ; ModuleID = 'a.carbon' // CHECK:STDOUT: source_filename = "a.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() { +// CHECK:STDOUT: define void @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -35,10 +35,13 @@ fn G() { A.F(); } // 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: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: ; ModuleID = 'b.carbon' // CHECK:STDOUT: source_filename = "b.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() { +// CHECK:STDOUT: define void @G() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @F() // CHECK:STDOUT: ret void @@ -53,3 +56,6 @@ fn G() { A.F(); } // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/pointer/address_of_field.carbon b/toolchain/lower/testdata/pointer/address_of_field.carbon index 17152c3d8ba7..038db4394d68 100644 --- a/toolchain/lower/testdata/pointer/address_of_field.carbon +++ b/toolchain/lower/testdata/pointer/address_of_field.carbon @@ -22,7 +22,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: declare void @G(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() { +// CHECK:STDOUT: define void @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %s.var = alloca { i32, i32 }, align 8 // CHECK:STDOUT: %.loc14_46.2.a = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 0 @@ -45,3 +45,6 @@ fn F() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/pointer/address_of_unused.carbon b/toolchain/lower/testdata/pointer/address_of_unused.carbon index d639108d9509..248b97a0e781 100644 --- a/toolchain/lower/testdata/pointer/address_of_unused.carbon +++ b/toolchain/lower/testdata/pointer/address_of_unused.carbon @@ -16,7 +16,7 @@ fn F() { // CHECK:STDOUT: ; ModuleID = 'address_of_unused.carbon' // CHECK:STDOUT: source_filename = "address_of_unused.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() { +// CHECK:STDOUT: define void @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %n.var = alloca i32, align 4 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4 @@ -30,3 +30,6 @@ fn F() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/pointer/basic.carbon b/toolchain/lower/testdata/pointer/basic.carbon index 194dd15d8219..d67e2931cd04 100644 --- a/toolchain/lower/testdata/pointer/basic.carbon +++ b/toolchain/lower/testdata/pointer/basic.carbon @@ -20,13 +20,13 @@ fn F() -> i32 { // CHECK:STDOUT: ; ModuleID = 'basic.carbon' // CHECK:STDOUT: source_filename = "basic.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @G(ptr %p) { +// CHECK:STDOUT: define i32 @G(ptr %p) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12_10.2 = load i32, ptr %p, align 4 // CHECK:STDOUT: ret i32 %.loc12_10.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F() { +// CHECK:STDOUT: define i32 @F() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %n.var = alloca i32, align 4 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4 @@ -41,3 +41,7 @@ fn F() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon b/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon index 50994234dcf0..bdd11fccdf23 100644 --- a/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon +++ b/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon @@ -18,7 +18,7 @@ fn F(p: i32**) -> i32 { // CHECK:STDOUT: ; ModuleID = 'pointer_to_pointer.carbon' // CHECK:STDOUT: source_filename = "pointer_to_pointer.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F(ptr %p) { +// CHECK:STDOUT: define i32 @F(ptr %p) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca ptr, align 8 // CHECK:STDOUT: store ptr %p, ptr %a.var, align 8 @@ -40,3 +40,6 @@ fn F(p: i32**) -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/return/code_after_return.carbon b/toolchain/lower/testdata/return/code_after_return.carbon index 84a23dc32c78..8669a6e83c36 100644 --- a/toolchain/lower/testdata/return/code_after_return.carbon +++ b/toolchain/lower/testdata/return/code_after_return.carbon @@ -18,12 +18,12 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'code_after_return.carbon' // CHECK:STDOUT: source_filename = "code_after_return.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() { +// CHECK:STDOUT: define void @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -35,3 +35,7 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/return/no_value.carbon b/toolchain/lower/testdata/return/no_value.carbon index d5a068b8b2fc..e8937422331b 100644 --- a/toolchain/lower/testdata/return/no_value.carbon +++ b/toolchain/lower/testdata/return/no_value.carbon @@ -15,7 +15,7 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'no_value.carbon' // CHECK:STDOUT: source_filename = "no_value.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() { +// CHECK:STDOUT: define void @Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } @@ -27,3 +27,6 @@ fn Main() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/return/return_var.carbon b/toolchain/lower/testdata/return/return_var.carbon index 9fe416aadd6a..46ee3b42136d 100644 --- a/toolchain/lower/testdata/return/return_var.carbon +++ b/toolchain/lower/testdata/return/return_var.carbon @@ -22,7 +22,7 @@ fn Make() -> C { // CHECK:STDOUT: ; ModuleID = 'return_var.carbon' // CHECK:STDOUT: source_filename = "return_var.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Make(ptr sret({ i32, ptr }) %return) { +// CHECK:STDOUT: define void @Make(ptr sret({ i32, ptr }) %return) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc18_30.2.data = getelementptr inbounds nuw { i32, ptr }, ptr %return, i32 0, i32 0 // CHECK:STDOUT: %.loc18_30.4.next = getelementptr inbounds nuw { i32, ptr }, ptr %return, i32 0, i32 1 @@ -37,3 +37,6 @@ fn Make() -> C { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Make", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/return/return_var_byval.carbon b/toolchain/lower/testdata/return/return_var_byval.carbon index 97e9e857d7b7..7c724d65f249 100644 --- a/toolchain/lower/testdata/return/return_var_byval.carbon +++ b/toolchain/lower/testdata/return/return_var_byval.carbon @@ -16,7 +16,7 @@ fn Main() -> i32 { // CHECK:STDOUT: ; ModuleID = 'return_var_byval.carbon' // CHECK:STDOUT: source_filename = "return_var_byval.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Main() { +// CHECK:STDOUT: define i32 @Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca i32, align 4 // CHECK:STDOUT: store i32 0, ptr %x.var, align 4 @@ -31,3 +31,6 @@ fn Main() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/return/value.carbon b/toolchain/lower/testdata/return/value.carbon index 66eded6f5fbd..a667e5d6c6a9 100644 --- a/toolchain/lower/testdata/return/value.carbon +++ b/toolchain/lower/testdata/return/value.carbon @@ -15,7 +15,7 @@ fn Main() -> i32 { // CHECK:STDOUT: ; ModuleID = 'value.carbon' // CHECK:STDOUT: source_filename = "value.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Main() { +// CHECK:STDOUT: define i32 @Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } @@ -27,3 +27,6 @@ fn Main() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/return/var.carbon b/toolchain/lower/testdata/return/var.carbon index dfbe465a4134..4407c24ccc94 100644 --- a/toolchain/lower/testdata/return/var.carbon +++ b/toolchain/lower/testdata/return/var.carbon @@ -16,7 +16,7 @@ fn Main() -> i32 { // CHECK:STDOUT: ; ModuleID = 'var.carbon' // CHECK:STDOUT: source_filename = "var.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Main() { +// CHECK:STDOUT: define i32 @Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca i32, align 4 // CHECK:STDOUT: store i32 0, ptr %x.var, align 4 @@ -31,3 +31,6 @@ fn Main() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/struct/empty.carbon b/toolchain/lower/testdata/struct/empty.carbon index b85518f3367e..4f4232ba480f 100644 --- a/toolchain/lower/testdata/struct/empty.carbon +++ b/toolchain/lower/testdata/struct/empty.carbon @@ -17,7 +17,7 @@ fn Run() -> i32 { // CHECK:STDOUT: ; ModuleID = 'empty.carbon' // CHECK:STDOUT: source_filename = "empty.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca {}, align 8 // CHECK:STDOUT: %y.var = alloca {}, align 8 @@ -31,3 +31,6 @@ fn Run() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/struct/member_access.carbon b/toolchain/lower/testdata/struct/member_access.carbon index 81e0f2304a12..f8c8ebf6355d 100644 --- a/toolchain/lower/testdata/struct/member_access.carbon +++ b/toolchain/lower/testdata/struct/member_access.carbon @@ -20,7 +20,7 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: @struct.loc12_49 = internal constant { double, i32 } { double 0.000000e+00, i32 1 } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { double, i32 }, align 8 // CHECK:STDOUT: %.loc12_48.2.a = getelementptr inbounds nuw { double, i32 }, ptr %x.var, i32 0, i32 0 @@ -48,3 +48,6 @@ fn Run() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/struct/nested_struct.carbon b/toolchain/lower/testdata/struct/nested_struct.carbon index 6e93fd79d5db..c328c11ada4d 100644 --- a/toolchain/lower/testdata/struct/nested_struct.carbon +++ b/toolchain/lower/testdata/struct/nested_struct.carbon @@ -16,7 +16,7 @@ fn Run() -> i32 { // CHECK:STDOUT: ; ModuleID = 'nested_struct.carbon' // CHECK:STDOUT: source_filename = "nested_struct.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } @@ -28,3 +28,6 @@ fn Run() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon index 549fda359108..c7e68045e6b6 100644 --- a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon @@ -19,7 +19,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: declare void @F(ptr sret({ i32, i32, i32 })) // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() { +// CHECK:STDOUT: define void @G() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca { { i32, i32, i32 }, { i32, i32, i32 } }, align 8 // CHECK:STDOUT: %.loc14_74.1.a = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 0 @@ -36,3 +36,6 @@ fn G() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/struct/one_entry.carbon b/toolchain/lower/testdata/struct/one_entry.carbon index 657665963d9a..a27158d916d2 100644 --- a/toolchain/lower/testdata/struct/one_entry.carbon +++ b/toolchain/lower/testdata/struct/one_entry.carbon @@ -17,7 +17,7 @@ fn Run() -> i32 { // CHECK:STDOUT: ; ModuleID = 'one_entry.carbon' // CHECK:STDOUT: source_filename = "one_entry.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { i32 }, align 8 // CHECK:STDOUT: store { i32 } { i32 4 }, ptr %x.var, align 4 @@ -36,3 +36,6 @@ fn Run() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/struct/two_entries.carbon b/toolchain/lower/testdata/struct/two_entries.carbon index 9e3c9e146d26..0de0f648ee30 100644 --- a/toolchain/lower/testdata/struct/two_entries.carbon +++ b/toolchain/lower/testdata/struct/two_entries.carbon @@ -19,7 +19,7 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: @struct.loc12_47 = internal constant { i32, i32 } { i32 1, i32 2 } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { i32, i32 }, align 8 // CHECK:STDOUT: %.loc12_46.2.a = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0 @@ -49,3 +49,6 @@ fn Run() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/tuple/access/element_access.carbon b/toolchain/lower/testdata/tuple/access/element_access.carbon index 84ef16fd5de1..7a4d1807756c 100644 --- a/toolchain/lower/testdata/tuple/access/element_access.carbon +++ b/toolchain/lower/testdata/tuple/access/element_access.carbon @@ -20,7 +20,7 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: @tuple.loc12_37 = internal constant { i32, i32, i32 } { i32 0, i32 1, i32 2 } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8 // CHECK:STDOUT: %.loc12_36.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0 @@ -50,3 +50,6 @@ fn Run() -> i32 { // 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: "element_access.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/tuple/access/return_value_access.carbon b/toolchain/lower/testdata/tuple/access/return_value_access.carbon index 775ce1e8cea0..2f9247edd19a 100644 --- a/toolchain/lower/testdata/tuple/access/return_value_access.carbon +++ b/toolchain/lower/testdata/tuple/access/return_value_access.carbon @@ -19,7 +19,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: @tuple.loc11_39 = internal constant { i32, i32 } { i32 12, i32 24 } // CHECK:STDOUT: -// CHECK:STDOUT: define void @F(ptr sret({ i32, i32 }) %return) { +// CHECK:STDOUT: define void @F(ptr sret({ i32, i32 }) %return) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc11_38.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 0 // CHECK:STDOUT: %.loc11_38.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1 @@ -27,7 +27,7 @@ fn Run() { // CHECK:STDOUT: ret void // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @main() { +// CHECK:STDOUT: define void @main() !dbg !7 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %t.var = alloca i32, align 4 // CHECK:STDOUT: %.loc14_17.1.temp = alloca { i32, i32 }, align 8 @@ -50,3 +50,7 @@ fn Run() { // 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_value_access.carbon", directory: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} +// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/tuple/empty.carbon b/toolchain/lower/testdata/tuple/empty.carbon index 71c06b1c5210..45b0f7931bc9 100644 --- a/toolchain/lower/testdata/tuple/empty.carbon +++ b/toolchain/lower/testdata/tuple/empty.carbon @@ -17,7 +17,7 @@ fn Run() -> i32 { // CHECK:STDOUT: ; ModuleID = 'empty.carbon' // CHECK:STDOUT: source_filename = "empty.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca {}, align 8 // CHECK:STDOUT: %y.var = alloca {}, align 8 @@ -31,3 +31,6 @@ fn Run() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/tuple/nested_tuple.carbon b/toolchain/lower/testdata/tuple/nested_tuple.carbon index 41e287e44a9a..695f7eaa6994 100644 --- a/toolchain/lower/testdata/tuple/nested_tuple.carbon +++ b/toolchain/lower/testdata/tuple/nested_tuple.carbon @@ -16,7 +16,7 @@ fn Run() -> i32 { // CHECK:STDOUT: ; ModuleID = 'nested_tuple.carbon' // CHECK:STDOUT: source_filename = "nested_tuple.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0 // CHECK:STDOUT: } @@ -28,3 +28,6 @@ fn Run() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon index 6437a64c1d63..dd8817dbf393 100644 --- a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon @@ -19,7 +19,7 @@ fn G() { // CHECK:STDOUT: // CHECK:STDOUT: declare void @F(ptr sret({ i32, i32, i32 })) // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() { +// CHECK:STDOUT: define void @G() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca { { i32, i32, i32 }, { i32, i32, i32 } }, align 8 // CHECK:STDOUT: %.loc14_56.1.tuple.elem = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 0 @@ -36,3 +36,6 @@ fn G() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/tuple/one_entry.carbon b/toolchain/lower/testdata/tuple/one_entry.carbon index 0da72917bb1f..4920b901a292 100644 --- a/toolchain/lower/testdata/tuple/one_entry.carbon +++ b/toolchain/lower/testdata/tuple/one_entry.carbon @@ -17,7 +17,7 @@ fn Run() -> i32 { // CHECK:STDOUT: ; ModuleID = 'one_entry.carbon' // CHECK:STDOUT: source_filename = "one_entry.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { i32 }, align 8 // CHECK:STDOUT: store { i32 } { i32 1 }, ptr %x.var, align 4 @@ -39,3 +39,6 @@ fn Run() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/tuple/two_entries.carbon b/toolchain/lower/testdata/tuple/two_entries.carbon index ee339ca236c5..098f777761fb 100644 --- a/toolchain/lower/testdata/tuple/two_entries.carbon +++ b/toolchain/lower/testdata/tuple/two_entries.carbon @@ -19,7 +19,7 @@ fn Run() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: @tuple.loc12_30 = internal constant { i32, i32 } { i32 12, i32 7 } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca { i32, i32 }, align 8 // CHECK:STDOUT: %.loc12_29.2.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %x.var, i32 0, i32 0 @@ -49,3 +49,6 @@ fn Run() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/tuple/value_formation.carbon b/toolchain/lower/testdata/tuple/value_formation.carbon index 27c3dc01147b..9a5ed628840c 100644 --- a/toolchain/lower/testdata/tuple/value_formation.carbon +++ b/toolchain/lower/testdata/tuple/value_formation.carbon @@ -21,7 +21,7 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: declare void @G(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() { +// CHECK:STDOUT: define void @F() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8 // CHECK:STDOUT: %b.var = alloca { i32, i32, i32 }, align 8 @@ -67,3 +67,6 @@ fn F() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/tuple/value_forwarding.carbon b/toolchain/lower/testdata/tuple/value_forwarding.carbon index d35387e7025f..687e47fd8d8c 100644 --- a/toolchain/lower/testdata/tuple/value_forwarding.carbon +++ b/toolchain/lower/testdata/tuple/value_forwarding.carbon @@ -19,7 +19,7 @@ fn F(a: (i32, i32, i32), b: (i32, i32, i32)) { // CHECK:STDOUT: // CHECK:STDOUT: declare void @G(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: define void @F(ptr %a, ptr %b) { +// CHECK:STDOUT: define void @F(ptr %a, ptr %b) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %tuple = alloca { ptr, ptr }, align 8 // CHECK:STDOUT: %tuple1 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple, i32 0, i32 0 @@ -37,3 +37,6 @@ fn F(a: (i32, i32, i32), b: (i32, i32, i32)) { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/var/local.carbon b/toolchain/lower/testdata/var/local.carbon index 01a069d9a9fd..c5485950499d 100644 --- a/toolchain/lower/testdata/var/local.carbon +++ b/toolchain/lower/testdata/var/local.carbon @@ -16,7 +16,7 @@ fn Run() -> i32 { // CHECK:STDOUT: ; ModuleID = 'local.carbon' // CHECK:STDOUT: source_filename = "local.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @main() { +// CHECK:STDOUT: define i32 @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca i32, align 4 // CHECK:STDOUT: store i32 1, ptr %x.var, align 4 @@ -31,3 +31,6 @@ fn Run() -> i32 { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/while/break_continue.carbon b/toolchain/lower/testdata/while/break_continue.carbon index 49403fc6baad..89825e17c335 100644 --- a/toolchain/lower/testdata/while/break_continue.carbon +++ b/toolchain/lower/testdata/while/break_continue.carbon @@ -28,7 +28,7 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: declare i1 @C() // CHECK:STDOUT: -// CHECK:STDOUT: define void @While() { +// CHECK:STDOUT: define void @While() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br label %while.cond // CHECK:STDOUT: @@ -67,3 +67,6 @@ fn While() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "While", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/while/preheader.carbon b/toolchain/lower/testdata/while/preheader.carbon index b131890e633d..598ee35dda98 100644 --- a/toolchain/lower/testdata/while/preheader.carbon +++ b/toolchain/lower/testdata/while/preheader.carbon @@ -37,7 +37,7 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: declare void @G() // CHECK:STDOUT: -// CHECK:STDOUT: define void @While() { +// CHECK:STDOUT: define void @While() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br label %while.cond.loc20 // CHECK:STDOUT: @@ -78,3 +78,6 @@ fn While() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "While", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/while/unreachable_end.carbon b/toolchain/lower/testdata/while/unreachable_end.carbon index 5e2d1a71da38..8620163fd02c 100644 --- a/toolchain/lower/testdata/while/unreachable_end.carbon +++ b/toolchain/lower/testdata/while/unreachable_end.carbon @@ -34,7 +34,7 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: declare void @H() // CHECK:STDOUT: -// CHECK:STDOUT: define void @While() { +// CHECK:STDOUT: define void @While() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @F() // CHECK:STDOUT: br label %while.cond @@ -59,3 +59,6 @@ fn While() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "While", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{} diff --git a/toolchain/lower/testdata/while/while.carbon b/toolchain/lower/testdata/while/while.carbon index 9a408935627c..3ad043e64ef4 100644 --- a/toolchain/lower/testdata/while/while.carbon +++ b/toolchain/lower/testdata/while/while.carbon @@ -33,7 +33,7 @@ fn While() { // CHECK:STDOUT: // CHECK:STDOUT: declare void @H() // CHECK:STDOUT: -// CHECK:STDOUT: define void @While() { +// CHECK:STDOUT: define void @While() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @F() // CHECK:STDOUT: br label %while.cond @@ -58,3 +58,6 @@ fn While() { // 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: "") +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "While", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !5 = !DISubroutineType(types: !6) +// CHECK:STDOUT: !6 = !{}