diff --git a/toolchain/codegen/testdata/assembly/basic.carbon b/toolchain/codegen/testdata/assembly/basic.carbon index 3b8c3e727c52..a0fc2061d5c2 100644 --- a/toolchain/codegen/testdata/assembly/basic.carbon +++ b/toolchain/codegen/testdata/assembly/basic.carbon @@ -5,6 +5,6 @@ // ARGS: compile --no-prelude-import --target=x86_64-unknown-linux-gnu --output=- %s // NOAUTOUPDATE // SET-CHECK-SUBSET -// CHECK:STDOUT: Main: +// CHECK:STDOUT: _CMain.Main: fn Main() {} diff --git a/toolchain/lower/BUILD b/toolchain/lower/BUILD index 9e8e1b69b8ae..273956b9fd4d 100644 --- a/toolchain/lower/BUILD +++ b/toolchain/lower/BUILD @@ -32,6 +32,8 @@ cc_library( "constant.h", "file_context.cpp", "function_context.cpp", + "mangler.cpp", + "mangler.h", ] + # Glob handler files to avoid missing any. glob([ diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index 82ef3ea7e40c..dec3328b7ae3 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -11,6 +11,7 @@ #include "toolchain/base/kind_switch.h" #include "toolchain/lower/constant.h" #include "toolchain/lower/function_context.h" +#include "toolchain/lower/mangler.h" #include "toolchain/sem_ir/entry_point.h" #include "toolchain/sem_ir/file.h" #include "toolchain/sem_ir/function.h" @@ -233,22 +234,15 @@ auto FileContext::BuildFunctionDecl(SemIR::FunctionId function_id) // Compute the return type to use for the LLVM function. If the initializing // representation doesn't produce a value, set the return type to void. + // TODO: For the `Run` entry point, remap return type to i32 if it doesn't + // return a value. llvm::Type* function_return_type = return_info.init_repr.kind == SemIR::InitRepr::ByCopy ? return_type : llvm::Type::getVoidTy(llvm_context()); - std::string mangled_name; - if (SemIR::IsEntryPoint(sem_ir(), function_id)) { - // TODO: Add an implicit `return 0` if `Run` doesn't return `i32`. - mangled_name = "main"; - } else { - // TODO: Decide on a name mangling scheme. - auto name = sem_ir().names().GetAsStringIfIdentifier(function.name_id); - CARBON_CHECK(name) << "Unexpected special name for function: " - << function.name_id; - mangled_name = *name; - } + Mangler m(*this); + std::string mangled_name = m.Mangle(function_id); llvm::FunctionType* function_type = llvm::FunctionType::get( function_return_type, param_types, /*isVarArg=*/false); diff --git a/toolchain/lower/mangler.cpp b/toolchain/lower/mangler.cpp new file mode 100644 index 000000000000..29cdc5737a33 --- /dev/null +++ b/toolchain/lower/mangler.cpp @@ -0,0 +1,115 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include "toolchain/lower/mangler.h" + +#include "toolchain/base/kind_switch.h" +#include "toolchain/sem_ir/entry_point.h" + +namespace Carbon::Lower { + +auto Mangler::MangleInverseQualifiedNameScope(llvm::raw_ostream& os, + SemIR::NameScopeId name_scope_id) + -> void { + // Maintain a stack of names for delayed rendering of interface impls. + struct NameEntry { + SemIR::NameScopeId name_scope_id; + + // The prefix emitted before this name component. If '\0', no prefix will be + // emitted. + // - Namespace components are separated by '.'. + // - The two components of an interface are separated by ':'. + char prefix; + }; + llvm::SmallVector names_to_render; + names_to_render.push_back({.name_scope_id = name_scope_id, .prefix = '.'}); + while (!names_to_render.empty()) { + auto [name_scope_id, prefix] = names_to_render.pop_back_val(); + if (prefix) { + os << prefix; + } + if (name_scope_id == SemIR::NameScopeId::Package) { + if (auto package_id = sem_ir().package_id(); package_id.is_valid()) { + os << sem_ir().identifiers().Get(package_id); + } else { + os << "Main"; + } + continue; + } + const auto& name_scope = sem_ir().name_scopes().Get(name_scope_id); + CARBON_KIND_SWITCH(sem_ir().insts().Get(name_scope.inst_id)) { + case CARBON_KIND(SemIR::ImplDecl impl_decl): { + const auto& impl = sem_ir().impls().Get(impl_decl.impl_id); + + auto interface_type = + types().GetAs(impl.constraint_id); + const auto& interface = + sem_ir().interfaces().Get(interface_type.interface_id); + names_to_render.push_back( + {.name_scope_id = interface.scope_id, .prefix = ':'}); + + CARBON_KIND_SWITCH(types().GetAsInst(impl.self_id)) { + case CARBON_KIND(SemIR::ClassType class_type): { + auto next_name_scope_id = + sem_ir().classes().Get(class_type.class_id).scope_id; + names_to_render.push_back( + {.name_scope_id = next_name_scope_id, .prefix = '\0'}); + break; + } + case CARBON_KIND(SemIR::BuiltinInst builtin_inst): { + os << builtin_inst.builtin_inst_kind.label(); + break; + } + default: + CARBON_FATAL() << "Attempting to mangle unsupported SemIR."; + break; + } + // Skip the tail of the loop that adds the parent name scope to the + // stack - the scope in which the impl was defined is not part of the + // mangling, the constraint and interface alone uniquelify identify an + // impl. + continue; + } + case CARBON_KIND(SemIR::ClassDecl class_decl): { + os << names().GetAsStringIfIdentifier( + sem_ir().classes().Get(class_decl.class_id).name_id); + break; + } + case CARBON_KIND(SemIR::InterfaceDecl interface_decl): { + os << names().GetAsStringIfIdentifier( + sem_ir().interfaces().Get(interface_decl.interface_id).name_id); + break; + } + case SemIR::Namespace::Kind: { + os << names().GetAsStringIfIdentifier(name_scope.name_id); + break; + } + default: + CARBON_FATAL() << "Attempting to mangle unsupported SemIR."; + break; + } + names_to_render.push_back( + {.name_scope_id = name_scope.parent_scope_id, .prefix = '.'}); + } +} + +auto Mangler::Mangle(SemIR::FunctionId function_id) -> std::string { + // FIXME: Add support for generic entities. + + const auto& function = sem_ir().functions().Get(function_id); + if (SemIR::IsEntryPoint(sem_ir(), function_id)) { + return "main"; + } + std::string result; + llvm::raw_string_ostream os(result); + os << "_C"; + + os << names().GetAsStringIfIdentifier(function.name_id); + + MangleInverseQualifiedNameScope(os, function.parent_scope_id); + + return os.str(); +} + +} // namespace Carbon::Lower diff --git a/toolchain/lower/mangler.h b/toolchain/lower/mangler.h new file mode 100644 index 000000000000..0ab3bcdd5b57 --- /dev/null +++ b/toolchain/lower/mangler.h @@ -0,0 +1,48 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef CARBON_TOOLCHAIN_LOWER_MANGLER_H_ +#define CARBON_TOOLCHAIN_LOWER_MANGLER_H_ + +#include + +#include "toolchain/lower/file_context.h" +#include "toolchain/sem_ir/ids.h" + +namespace Carbon::Lower { + +// A class for producing mangled (deterministically unique, at least partially +// human readable) names for externally referenceable entities such as +// functions. +class Mangler { + public: + // Initialize a new Mangler instance for mangling entities within the + // specified `FileContext`. + explicit Mangler(FileContext& file_context) : file_context_(file_context) {} + + // Produce a deterministically unique mangled name for the function specified + // by `function_id`. + auto Mangle(SemIR::FunctionId function_id) -> std::string; + + private: + // Mangle this qualified name with inner scope first, working outwards. This + // may reduce the incidence of common prefixes in the name mangling. (i.e.: + // every standard library name won't have a common prefix that has to be + // skipped and compared before getting to the interesting part) + auto MangleInverseQualifiedNameScope(llvm::raw_ostream& os, + SemIR::NameScopeId name_scope_id) + -> void; + + auto sem_ir() const -> const SemIR::File& { return file_context_.sem_ir(); } + + auto names() const -> SemIR::NameStoreWrapper { return sem_ir().names(); } + + auto types() const -> SemIR::TypeStore { return sem_ir().types(); } + + FileContext& file_context_; +}; + +} // namespace Carbon::Lower + +#endif // CARBON_TOOLCHAIN_LOWER_MANGLER_H_ diff --git a/toolchain/lower/testdata/alias/local.carbon b/toolchain/lower/testdata/alias/local.carbon index df04a9ea44e0..357d7d157db0 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() !dbg !4 { +// CHECK:STDOUT: define i32 @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !7 // CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !8 @@ -32,7 +32,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: "local.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/array/array_in_place.carbon b/toolchain/lower/testdata/array/array_in_place.carbon index 91432af7ba67..f446adac9069 100644 --- a/toolchain/lower/testdata/array/array_in_place.carbon +++ b/toolchain/lower/testdata/array/array_in_place.carbon @@ -17,15 +17,15 @@ fn G() { // CHECK:STDOUT: ; ModuleID = 'array_in_place.carbon' // CHECK:STDOUT: source_filename = "array_in_place.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: declare void @F(ptr sret({ i32, i32, i32 })) +// CHECK:STDOUT: declare void @_CF.Main(ptr sret({ i32, i32, i32 })) // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() !dbg !4 { +// CHECK:STDOUT: define void @_CG.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca [2 x { i32, i32, i32 }], align 8, !dbg !7 // CHECK:STDOUT: %.loc14_42.2.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: call void @F(ptr %.loc14_42.2.array.index), !dbg !9 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_42.2.array.index), !dbg !9 // CHECK:STDOUT: %.loc14_42.5.array.index = getelementptr inbounds [2 x { i32, i32, i32 }], ptr %v.var, i32 0, i32 1, !dbg !8 -// CHECK:STDOUT: call void @F(ptr %.loc14_42.5.array.index), !dbg !10 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_42.5.array.index), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -36,7 +36,7 @@ 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", linkageName: "G", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/array/assign_return_value.carbon b/toolchain/lower/testdata/array/assign_return_value.carbon index b24670f0b6f0..c744d8b8c330 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) !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main(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, !dbg !7 // CHECK:STDOUT: %.loc11_38.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 @@ -31,7 +31,7 @@ fn Run() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %t.var = alloca [2 x i32], align 4, !dbg !10 // CHECK:STDOUT: %.loc14_22.1.temp = alloca { i32, i32 }, align 8, !dbg !11 -// CHECK:STDOUT: call void @F(ptr %.loc14_22.1.temp), !dbg !11 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_22.1.temp), !dbg !11 // CHECK:STDOUT: %.loc14_22.3.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc14_22.1.temp, i32 0, i32 0, !dbg !11 // CHECK:STDOUT: %.loc14_22.4 = load i32, ptr %.loc14_22.3.tuple.elem, align 4, !dbg !11 // CHECK:STDOUT: %.loc14_22.6.array.index = getelementptr inbounds [2 x i32], ptr %t.var, i32 0, i32 0, !dbg !11 @@ -55,7 +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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 31, scope: !4) diff --git a/toolchain/lower/testdata/array/function_param.carbon b/toolchain/lower/testdata/array/function_param.carbon index 76aac8284789..6ddec2e2fe99 100644 --- a/toolchain/lower/testdata/array/function_param.carbon +++ b/toolchain/lower/testdata/array/function_param.carbon @@ -21,21 +21,21 @@ 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) !dbg !4 { +// CHECK:STDOUT: define i32 @_CF.Main(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, !dbg !7 // CHECK:STDOUT: %.loc12_15.3 = load i32, ptr %.loc12_15.2.array.index, align 4, !dbg !7 // CHECK:STDOUT: ret i32 %.loc12_15.3, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @G() !dbg !9 { +// CHECK:STDOUT: define i32 @_CG.Main() !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc16_20.2.temp = alloca [3 x i32], align 4, !dbg !10 // CHECK:STDOUT: %.loc16_20.4.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.2.temp, i32 0, i32 0, !dbg !10 // CHECK:STDOUT: %.loc16_20.7.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.2.temp, i32 0, i32 1, !dbg !10 // CHECK:STDOUT: %.loc16_20.10.array.index = getelementptr inbounds [3 x i32], ptr %.loc16_20.2.temp, i32 0, i32 2, !dbg !10 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %.loc16_20.2.temp, ptr align 4 @array.loc16_11.1, i64 12, i1 false), !dbg !11 -// CHECK:STDOUT: %F.call = call i32 @F(ptr %.loc16_20.2.temp, i32 1), !dbg !11 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr %.loc16_20.2.temp, i32 1), !dbg !11 // CHECK:STDOUT: ret i32 %F.call, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -51,12 +51,12 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 10, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "G", linkageName: "G", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !10 = !DILocation(line: 16, column: 12, scope: !9) // CHECK:STDOUT: !11 = !DILocation(line: 16, column: 10, scope: !9) // CHECK:STDOUT: !12 = !DILocation(line: 16, column: 3, scope: !9) diff --git a/toolchain/lower/testdata/basics/false_true.carbon b/toolchain/lower/testdata/basics/false_true.carbon index 892dcbb604a8..e87edff19b18 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() !dbg !4 { +// CHECK:STDOUT: define i1 @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 false, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @T() !dbg !8 { +// CHECK:STDOUT: define i1 @_CT.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 true, !dbg !9 // CHECK:STDOUT: } @@ -36,9 +36,9 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "T", linkageName: "T", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "T", linkageName: "_CT.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 3, scope: !8) diff --git a/toolchain/lower/testdata/basics/int_types.carbon b/toolchain/lower/testdata/basics/int_types.carbon index 5c2cb942b8fc..fe588c84723f 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) !dbg !4 { +// CHECK:STDOUT: define i8 @_CF_i8.Main(i8 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i8 %a, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i16 @F_u16(i16 %a) !dbg !8 { +// CHECK:STDOUT: define i16 @_CF_u16.Main(i16 %a) !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i16 %a, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @F_i64(i64 %a) !dbg !10 { +// CHECK:STDOUT: define i64 @_CF_i64.Main(i64 %a) !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i64 %a, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i65536 @F_u65536(i65536 %a) !dbg !12 { +// CHECK:STDOUT: define i65536 @_CF_u65536.Main(i65536 %a) !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i65536 %a, !dbg !13 // CHECK:STDOUT: } @@ -43,13 +43,13 @@ 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", linkageName: "F_i8", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F_i8", linkageName: "_CF_i8.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 24, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "F_u16", linkageName: "F_u16", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "F_u16", linkageName: "_CF_u16.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 27, scope: !8) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "F_i64", linkageName: "F_i64", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "F_i64", linkageName: "_CF_i64.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !11 = !DILocation(line: 13, column: 27, scope: !10) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F_u65536", linkageName: "F_u65536", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "F_u65536", linkageName: "_CF_u65536.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !13 = !DILocation(line: 14, column: 36, scope: !12) diff --git a/toolchain/lower/testdata/basics/numeric_literals.carbon b/toolchain/lower/testdata/basics/numeric_literals.carbon index a06a1e38aad3..ac9faab62d5e 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() !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %ints.var = alloca [4 x i32], align 4, !dbg !7 // CHECK:STDOUT: %.loc19_3.3.array.index = getelementptr inbounds [4 x i32], ptr %ints.var, i32 0, i32 0, !dbg !8 @@ -67,7 +67,7 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/basics/type_values.carbon b/toolchain/lower/testdata/basics/type_values.carbon index e1e826b65aeb..46d753ddb488 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() !dbg !4 { +// CHECK:STDOUT: define %type @_CI32.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret %type zeroinitializer, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define %type @I48() !dbg !8 { +// CHECK:STDOUT: define %type @_CI48.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret %type zeroinitializer, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define %type @F64() !dbg !10 { +// CHECK:STDOUT: define %type @_CF64.Main() !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret %type zeroinitializer, !dbg !11 // CHECK:STDOUT: } @@ -50,11 +50,11 @@ 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", linkageName: "I32", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "I32", linkageName: "_CI32.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 15, column: 3, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "I48", linkageName: "I48", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "I48", linkageName: "_CI48.Main", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 19, column: 3, scope: !8) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "F64", linkageName: "F64", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "F64", linkageName: "_CF64.Main", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !11 = !DILocation(line: 23, column: 3, scope: !10) diff --git a/toolchain/lower/testdata/basics/zero.carbon b/toolchain/lower/testdata/basics/zero.carbon index f30827b032f4..b3bf6e2519af 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() !dbg !4 { +// CHECK:STDOUT: define i32 @_CMain.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0, !dbg !7 // CHECK:STDOUT: } @@ -27,7 +27,7 @@ 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", linkageName: "Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/builtins/float.carbon b/toolchain/lower/testdata/builtins/float.carbon index 357ec1dcd1fd..ff3bff56ba69 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) !dbg !4 { +// CHECK:STDOUT: define double @_CTestNegate.Main(double %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.negate = fneg double %a, !dbg !7 // CHECK:STDOUT: ret double %float.negate, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define double @TestAdd(double %a, double %b) !dbg !9 { +// CHECK:STDOUT: define double @_CTestAdd.Main(double %a, double %b) !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.add = fadd double %a, %b, !dbg !10 // CHECK:STDOUT: ret double %float.add, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define double @TestSub(double %a, double %b) !dbg !12 { +// CHECK:STDOUT: define double @_CTestSub.Main(double %a, double %b) !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.sub = fsub double %a, %b, !dbg !13 // CHECK:STDOUT: ret double %float.sub, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define double @TestMul(double %a, double %b) !dbg !15 { +// CHECK:STDOUT: define double @_CTestMul.Main(double %a, double %b) !dbg !15 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.mul = fmul double %a, %b, !dbg !16 // CHECK:STDOUT: ret double %float.mul, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define double @TestDiv(double %a, double %b) !dbg !18 { +// CHECK:STDOUT: define double @_CTestDiv.Main(double %a, double %b) !dbg !18 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.div = fdiv double %a, %b, !dbg !19 // CHECK:STDOUT: ret double %float.div, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestEq(double %a, double %b) !dbg !21 { +// CHECK:STDOUT: define i1 @_CTestEq.Main(double %a, double %b) !dbg !21 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.eq = fcmp oeq double %a, %b, !dbg !22 // CHECK:STDOUT: ret i1 %float.eq, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestNeq(double %a, double %b) !dbg !24 { +// CHECK:STDOUT: define i1 @_CTestNeq.Main(double %a, double %b) !dbg !24 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.neq = fcmp one double %a, %b, !dbg !25 // CHECK:STDOUT: ret i1 %float.neq, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestLess(double %a, double %b) !dbg !27 { +// CHECK:STDOUT: define i1 @_CTestLess.Main(double %a, double %b) !dbg !27 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.less = fcmp olt double %a, %b, !dbg !28 // CHECK:STDOUT: ret i1 %float.less, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestLessEq(double %a, double %b) !dbg !30 { +// CHECK:STDOUT: define i1 @_CTestLessEq.Main(double %a, double %b) !dbg !30 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.less_eq = fcmp ole double %a, %b, !dbg !31 // CHECK:STDOUT: ret i1 %float.less_eq, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestGreater(double %a, double %b) !dbg !33 { +// CHECK:STDOUT: define i1 @_CTestGreater.Main(double %a, double %b) !dbg !33 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.greater = fcmp ogt double %a, %b, !dbg !34 // CHECK:STDOUT: ret i1 %float.greater, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestGreaterEq(double %a, double %b) !dbg !36 { +// CHECK:STDOUT: define i1 @_CTestGreaterEq.Main(double %a, double %b) !dbg !36 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %float.greater_eq = fcmp oge double %a, %b, !dbg !37 // CHECK:STDOUT: ret i1 %float.greater_eq, !dbg !38 @@ -117,38 +117,38 @@ 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", linkageName: "TestNegate", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "TestNegate", linkageName: "_CTestNegate.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 39, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 32, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestAdd", linkageName: "TestAdd", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestAdd", linkageName: "_CTestAdd.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 44, scope: !9) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 37, scope: !9) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "TestSub", linkageName: "TestSub", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "TestSub", linkageName: "_CTestSub.Main", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !13 = !DILocation(line: 18, column: 44, scope: !12) // CHECK:STDOUT: !14 = !DILocation(line: 18, column: 37, scope: !12) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "TestMul", linkageName: "TestMul", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "TestMul", linkageName: "_CTestMul.Main", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !16 = !DILocation(line: 21, column: 44, scope: !15) // CHECK:STDOUT: !17 = !DILocation(line: 21, column: 37, scope: !15) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "TestDiv", linkageName: "TestDiv", scope: null, file: !3, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "TestDiv", linkageName: "_CTestDiv.Main", scope: null, file: !3, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !19 = !DILocation(line: 24, column: 44, scope: !18) // CHECK:STDOUT: !20 = !DILocation(line: 24, column: 37, scope: !18) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "TestEq", linkageName: "TestEq", scope: null, file: !3, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "TestEq", linkageName: "_CTestEq.Main", scope: null, file: !3, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !22 = !DILocation(line: 27, column: 44, scope: !21) // CHECK:STDOUT: !23 = !DILocation(line: 27, column: 37, scope: !21) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "TestNeq", linkageName: "TestNeq", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "TestNeq", linkageName: "_CTestNeq.Main", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !25 = !DILocation(line: 30, column: 45, scope: !24) // CHECK:STDOUT: !26 = !DILocation(line: 30, column: 38, scope: !24) -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "TestLess", linkageName: "TestLess", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "TestLess", linkageName: "_CTestLess.Main", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !28 = !DILocation(line: 33, column: 46, scope: !27) // CHECK:STDOUT: !29 = !DILocation(line: 33, column: 39, scope: !27) -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "TestLessEq", linkageName: "TestLessEq", scope: null, file: !3, line: 36, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "TestLessEq", linkageName: "_CTestLessEq.Main", scope: null, file: !3, line: 36, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !31 = !DILocation(line: 36, column: 48, scope: !30) // CHECK:STDOUT: !32 = !DILocation(line: 36, column: 41, scope: !30) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "TestGreater", linkageName: "TestGreater", scope: null, file: !3, line: 39, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "TestGreater", linkageName: "_CTestGreater.Main", scope: null, file: !3, line: 39, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !34 = !DILocation(line: 39, column: 49, scope: !33) // CHECK:STDOUT: !35 = !DILocation(line: 39, column: 42, scope: !33) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "TestGreaterEq", linkageName: "TestGreaterEq", scope: null, file: !3, line: 42, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "TestGreaterEq", linkageName: "_CTestGreaterEq.Main", scope: null, file: !3, line: 42, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !37 = !DILocation(line: 42, column: 51, scope: !36) // CHECK:STDOUT: !38 = !DILocation(line: 42, column: 44, scope: !36) diff --git a/toolchain/lower/testdata/builtins/int.carbon b/toolchain/lower/testdata/builtins/int.carbon index 39063db372f5..51ee33fd7c20 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) !dbg !4 { +// CHECK:STDOUT: define i32 @_CTestNegate.Main(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.snegate = sub i32 0, %a, !dbg !7 // CHECK:STDOUT: ret i32 %int.snegate, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestAdd(i32 %a, i32 %b) !dbg !9 { +// CHECK:STDOUT: define i32 @_CTestAdd.Main(i32 %a, i32 %b) !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.sadd = add i32 %a, %b, !dbg !10 // CHECK:STDOUT: ret i32 %int.sadd, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestSub(i32 %a, i32 %b) !dbg !12 { +// CHECK:STDOUT: define i32 @_CTestSub.Main(i32 %a, i32 %b) !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.ssub = sub i32 %a, %b, !dbg !13 // CHECK:STDOUT: ret i32 %int.ssub, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestMul(i32 %a, i32 %b) !dbg !15 { +// CHECK:STDOUT: define i32 @_CTestMul.Main(i32 %a, i32 %b) !dbg !15 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.smul = mul i32 %a, %b, !dbg !16 // CHECK:STDOUT: ret i32 %int.smul, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestDiv(i32 %a, i32 %b) !dbg !18 { +// CHECK:STDOUT: define i32 @_CTestDiv.Main(i32 %a, i32 %b) !dbg !18 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.sdiv = sdiv i32 %a, %b, !dbg !19 // CHECK:STDOUT: ret i32 %int.sdiv, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestMod(i32 %a, i32 %b) !dbg !21 { +// CHECK:STDOUT: define i32 @_CTestMod.Main(i32 %a, i32 %b) !dbg !21 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.smod = srem i32 %a, %b, !dbg !22 // CHECK:STDOUT: ret i32 %int.smod, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestComplement(i32 %a) !dbg !24 { +// CHECK:STDOUT: define i32 @_CTestComplement.Main(i32 %a) !dbg !24 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.complement = xor i32 -1, %a, !dbg !25 // CHECK:STDOUT: ret i32 %int.complement, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestAnd(i32 %a, i32 %b) !dbg !27 { +// CHECK:STDOUT: define i32 @_CTestAnd.Main(i32 %a, i32 %b) !dbg !27 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.and = and i32 %a, %b, !dbg !28 // CHECK:STDOUT: ret i32 %int.and, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestOr(i32 %a, i32 %b) !dbg !30 { +// CHECK:STDOUT: define i32 @_CTestOr.Main(i32 %a, i32 %b) !dbg !30 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.or = or i32 %a, %b, !dbg !31 // CHECK:STDOUT: ret i32 %int.or, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestXor(i32 %a, i32 %b) !dbg !33 { +// CHECK:STDOUT: define i32 @_CTestXor.Main(i32 %a, i32 %b) !dbg !33 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.xor = xor i32 %a, %b, !dbg !34 // CHECK:STDOUT: ret i32 %int.xor, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestLeftShift(i32 %a, i32 %b) !dbg !36 { +// CHECK:STDOUT: define i32 @_CTestLeftShift.Main(i32 %a, i32 %b) !dbg !36 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.left_shift = shl i32 %a, %b, !dbg !37 // CHECK:STDOUT: ret i32 %int.left_shift, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestRightShift(i32 %a, i32 %b) !dbg !39 { +// CHECK:STDOUT: define i32 @_CTestRightShift.Main(i32 %a, i32 %b) !dbg !39 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.right_shift = ashr i32 %a, %b, !dbg !40 // CHECK:STDOUT: ret i32 %int.right_shift, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestEq(i32 %a, i32 %b) !dbg !42 { +// CHECK:STDOUT: define i1 @_CTestEq.Main(i32 %a, i32 %b) !dbg !42 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.eq = icmp eq i32 %a, %b, !dbg !43 // CHECK:STDOUT: ret i1 %int.eq, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestNeq(i32 %a, i32 %b) !dbg !45 { +// CHECK:STDOUT: define i1 @_CTestNeq.Main(i32 %a, i32 %b) !dbg !45 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.neq = icmp ne i32 %a, %b, !dbg !46 // CHECK:STDOUT: ret i1 %int.neq, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestLess(i32 %a, i32 %b) !dbg !48 { +// CHECK:STDOUT: define i1 @_CTestLess.Main(i32 %a, i32 %b) !dbg !48 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.less = icmp slt i32 %a, %b, !dbg !49 // CHECK:STDOUT: ret i1 %int.less, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestLessEq(i32 %a, i32 %b) !dbg !51 { +// CHECK:STDOUT: define i1 @_CTestLessEq.Main(i32 %a, i32 %b) !dbg !51 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.less_eq = icmp sle i32 %a, %b, !dbg !52 // CHECK:STDOUT: ret i1 %int.less_eq, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestGreater(i32 %a, i32 %b) !dbg !54 { +// CHECK:STDOUT: define i1 @_CTestGreater.Main(i32 %a, i32 %b) !dbg !54 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.greater = icmp sgt i32 %a, %b, !dbg !55 // CHECK:STDOUT: ret i1 %int.greater, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestGreaterEq(i32 %a, i32 %b) !dbg !57 { +// CHECK:STDOUT: define i1 @_CTestGreaterEq.Main(i32 %a, i32 %b) !dbg !57 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.greater_eq = icmp sge i32 %a, %b, !dbg !58 // CHECK:STDOUT: ret i1 %int.greater_eq, !dbg !59 @@ -180,59 +180,59 @@ 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", linkageName: "TestNegate", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "TestNegate", linkageName: "_CTestNegate.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 39, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 32, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestAdd", linkageName: "TestAdd", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestAdd", linkageName: "_CTestAdd.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 44, scope: !9) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 37, scope: !9) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "TestSub", linkageName: "TestSub", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "TestSub", linkageName: "_CTestSub.Main", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !13 = !DILocation(line: 18, column: 44, scope: !12) // CHECK:STDOUT: !14 = !DILocation(line: 18, column: 37, scope: !12) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "TestMul", linkageName: "TestMul", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "TestMul", linkageName: "_CTestMul.Main", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !16 = !DILocation(line: 21, column: 44, scope: !15) // CHECK:STDOUT: !17 = !DILocation(line: 21, column: 37, scope: !15) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "TestDiv", linkageName: "TestDiv", scope: null, file: !3, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "TestDiv", linkageName: "_CTestDiv.Main", scope: null, file: !3, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !19 = !DILocation(line: 24, column: 44, scope: !18) // CHECK:STDOUT: !20 = !DILocation(line: 24, column: 37, scope: !18) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "TestMod", linkageName: "TestMod", scope: null, file: !3, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "TestMod", linkageName: "_CTestMod.Main", scope: null, file: !3, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !22 = !DILocation(line: 27, column: 44, scope: !21) // CHECK:STDOUT: !23 = !DILocation(line: 27, column: 37, scope: !21) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "TestComplement", linkageName: "TestComplement", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "TestComplement", linkageName: "_CTestComplement.Main", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !25 = !DILocation(line: 30, column: 43, scope: !24) // CHECK:STDOUT: !26 = !DILocation(line: 30, column: 36, scope: !24) -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "TestAnd", linkageName: "TestAnd", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "TestAnd", linkageName: "_CTestAnd.Main", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !28 = !DILocation(line: 33, column: 44, scope: !27) // CHECK:STDOUT: !29 = !DILocation(line: 33, column: 37, scope: !27) -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "TestOr", linkageName: "TestOr", scope: null, file: !3, line: 36, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "TestOr", linkageName: "_CTestOr.Main", scope: null, file: !3, line: 36, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !31 = !DILocation(line: 36, column: 43, scope: !30) // CHECK:STDOUT: !32 = !DILocation(line: 36, column: 36, scope: !30) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "TestXor", linkageName: "TestXor", scope: null, file: !3, line: 39, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "TestXor", linkageName: "_CTestXor.Main", scope: null, file: !3, line: 39, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !34 = !DILocation(line: 39, column: 44, scope: !33) // CHECK:STDOUT: !35 = !DILocation(line: 39, column: 37, scope: !33) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "TestLeftShift", linkageName: "TestLeftShift", scope: null, file: !3, line: 42, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "TestLeftShift", linkageName: "_CTestLeftShift.Main", scope: null, file: !3, line: 42, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !37 = !DILocation(line: 42, column: 50, scope: !36) // CHECK:STDOUT: !38 = !DILocation(line: 42, column: 43, scope: !36) -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "TestRightShift", linkageName: "TestRightShift", scope: null, file: !3, line: 45, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "TestRightShift", linkageName: "_CTestRightShift.Main", scope: null, file: !3, line: 45, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !40 = !DILocation(line: 45, column: 51, scope: !39) // CHECK:STDOUT: !41 = !DILocation(line: 45, column: 44, scope: !39) -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "TestEq", linkageName: "TestEq", scope: null, file: !3, line: 48, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "TestEq", linkageName: "_CTestEq.Main", scope: null, file: !3, line: 48, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !43 = !DILocation(line: 48, column: 44, scope: !42) // CHECK:STDOUT: !44 = !DILocation(line: 48, column: 37, scope: !42) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "TestNeq", linkageName: "TestNeq", scope: null, file: !3, line: 51, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "TestNeq", linkageName: "_CTestNeq.Main", scope: null, file: !3, line: 51, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !46 = !DILocation(line: 51, column: 45, scope: !45) // CHECK:STDOUT: !47 = !DILocation(line: 51, column: 38, scope: !45) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "TestLess", linkageName: "TestLess", scope: null, file: !3, line: 54, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "TestLess", linkageName: "_CTestLess.Main", scope: null, file: !3, line: 54, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !49 = !DILocation(line: 54, column: 46, scope: !48) // CHECK:STDOUT: !50 = !DILocation(line: 54, column: 39, scope: !48) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "TestLessEq", linkageName: "TestLessEq", scope: null, file: !3, line: 57, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "TestLessEq", linkageName: "_CTestLessEq.Main", scope: null, file: !3, line: 57, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !52 = !DILocation(line: 57, column: 48, scope: !51) // CHECK:STDOUT: !53 = !DILocation(line: 57, column: 41, scope: !51) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "TestGreater", linkageName: "TestGreater", scope: null, file: !3, line: 60, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "TestGreater", linkageName: "_CTestGreater.Main", scope: null, file: !3, line: 60, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !55 = !DILocation(line: 60, column: 49, scope: !54) // CHECK:STDOUT: !56 = !DILocation(line: 60, column: 42, scope: !54) -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "TestGreaterEq", linkageName: "TestGreaterEq", scope: null, file: !3, line: 63, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "TestGreaterEq", linkageName: "_CTestGreaterEq.Main", scope: null, file: !3, line: 63, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !58 = !DILocation(line: 63, column: 51, scope: !57) // CHECK:STDOUT: !59 = !DILocation(line: 63, column: 44, scope: !57) diff --git a/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon b/toolchain/lower/testdata/builtins/method_vs_nonmethod.carbon index 5cefc7af7d5d..c759e6557a38 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) !dbg !4 { +// CHECK:STDOUT: define i32 @_CTestAddNonmethod.Main(i32 %a, i32 %b) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.sadd = add i32 %a, %b, !dbg !7 // CHECK:STDOUT: ret i32 %int.sadd, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TestAddMethod(i32 %a, i32 %b) !dbg !9 { +// CHECK:STDOUT: define i32 @_CTestAddMethod.Main(i32 %a, i32 %b) !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.sadd = add i32 %a, %b, !dbg !10 // CHECK:STDOUT: ret i32 %int.sadd, !dbg !11 @@ -36,11 +36,11 @@ 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", linkageName: "TestAddNonmethod", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "TestAddNonmethod", linkageName: "_CTestAddNonmethod.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 53, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 14, column: 46, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestAddMethod", linkageName: "TestAddMethod", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestAddMethod", linkageName: "_CTestAddMethod.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 50, scope: !9) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 43, scope: !9) diff --git a/toolchain/lower/testdata/builtins/overloaded_operator.carbon b/toolchain/lower/testdata/builtins/overloaded_operator.carbon index ff5b82a41599..3b9064f1ea49 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) !dbg !4 { +// CHECK:STDOUT: define i32 @_CAddThreeIntegers.Main(i32 %a, i32 %b, i32 %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.sadd.loc18_12 = add i32 %a, %b, !dbg !7 // CHECK:STDOUT: %.loc18_12.3.temp = alloca i32, align 4, !dbg !7 @@ -38,7 +38,7 @@ 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", linkageName: "AddThreeIntegers", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "AddThreeIntegers", linkageName: "_CAddThreeIntegers.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 18, column: 10, scope: !4) diff --git a/toolchain/lower/testdata/builtins/print.carbon b/toolchain/lower/testdata/builtins/print.carbon index 577cef9d00a3..b3666bc72949 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() !dbg !4 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %print.int.printf = call i32 (ptr, ...) @printf(ptr @printf.int.format, i32 1), !dbg !7 // CHECK:STDOUT: ret void, !dbg !8 @@ -32,7 +32,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: "print.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/builtins/types.carbon b/toolchain/lower/testdata/builtins/types.carbon index dc84466143c3..25b716c6c55a 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() !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %i.var = alloca i32, align 4, !dbg !7 // CHECK:STDOUT: store i32 0, ptr %i.var, align 4, !dbg !8 @@ -39,7 +39,7 @@ 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", linkageName: "F", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 16, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/builtins/uint.carbon b/toolchain/lower/testdata/builtins/uint.carbon index 275f433bbafc..25c13a04d162 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) !dbg !4 { +// CHECK:STDOUT: define i64 @_CTestNegate.Main(i64 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.unegate = sub i64 0, %a, !dbg !7 // CHECK:STDOUT: ret i64 %int.unegate, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestAdd(i64 %a, i64 %b) !dbg !9 { +// CHECK:STDOUT: define i64 @_CTestAdd.Main(i64 %a, i64 %b) !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.uadd = add i64 %a, %b, !dbg !10 // CHECK:STDOUT: ret i64 %int.uadd, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestSub(i64 %a, i64 %b) !dbg !12 { +// CHECK:STDOUT: define i64 @_CTestSub.Main(i64 %a, i64 %b) !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.usub = sub i64 %a, %b, !dbg !13 // CHECK:STDOUT: ret i64 %int.usub, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestMul(i64 %a, i64 %b) !dbg !15 { +// CHECK:STDOUT: define i64 @_CTestMul.Main(i64 %a, i64 %b) !dbg !15 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.umul = mul i64 %a, %b, !dbg !16 // CHECK:STDOUT: ret i64 %int.umul, !dbg !17 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestDiv(i64 %a, i64 %b) !dbg !18 { +// CHECK:STDOUT: define i64 @_CTestDiv.Main(i64 %a, i64 %b) !dbg !18 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.udiv = udiv i64 %a, %b, !dbg !19 // CHECK:STDOUT: ret i64 %int.udiv, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestMod(i64 %a, i64 %b) !dbg !21 { +// CHECK:STDOUT: define i64 @_CTestMod.Main(i64 %a, i64 %b) !dbg !21 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.umod = urem i64 %a, %b, !dbg !22 // CHECK:STDOUT: ret i64 %int.umod, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestComplement(i64 %a) !dbg !24 { +// CHECK:STDOUT: define i64 @_CTestComplement.Main(i64 %a) !dbg !24 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.complement = xor i64 -1, %a, !dbg !25 // CHECK:STDOUT: ret i64 %int.complement, !dbg !26 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestAnd(i64 %a, i64 %b) !dbg !27 { +// CHECK:STDOUT: define i64 @_CTestAnd.Main(i64 %a, i64 %b) !dbg !27 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.and = and i64 %a, %b, !dbg !28 // CHECK:STDOUT: ret i64 %int.and, !dbg !29 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestOr(i64 %a, i64 %b) !dbg !30 { +// CHECK:STDOUT: define i64 @_CTestOr.Main(i64 %a, i64 %b) !dbg !30 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.or = or i64 %a, %b, !dbg !31 // CHECK:STDOUT: ret i64 %int.or, !dbg !32 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestXor(i64 %a, i64 %b) !dbg !33 { +// CHECK:STDOUT: define i64 @_CTestXor.Main(i64 %a, i64 %b) !dbg !33 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.xor = xor i64 %a, %b, !dbg !34 // CHECK:STDOUT: ret i64 %int.xor, !dbg !35 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestLeftShift(i64 %a, i64 %b) !dbg !36 { +// CHECK:STDOUT: define i64 @_CTestLeftShift.Main(i64 %a, i64 %b) !dbg !36 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.left_shift = shl i64 %a, %b, !dbg !37 // CHECK:STDOUT: ret i64 %int.left_shift, !dbg !38 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i64 @TestRightShift(i64 %a, i64 %b) !dbg !39 { +// CHECK:STDOUT: define i64 @_CTestRightShift.Main(i64 %a, i64 %b) !dbg !39 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.right_shift = lshr i64 %a, %b, !dbg !40 // CHECK:STDOUT: ret i64 %int.right_shift, !dbg !41 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestEq(i64 %a, i64 %b) !dbg !42 { +// CHECK:STDOUT: define i1 @_CTestEq.Main(i64 %a, i64 %b) !dbg !42 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.eq = icmp eq i64 %a, %b, !dbg !43 // CHECK:STDOUT: ret i1 %int.eq, !dbg !44 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestNeq(i64 %a, i64 %b) !dbg !45 { +// CHECK:STDOUT: define i1 @_CTestNeq.Main(i64 %a, i64 %b) !dbg !45 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.neq = icmp ne i64 %a, %b, !dbg !46 // CHECK:STDOUT: ret i1 %int.neq, !dbg !47 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestLess(i64 %a, i64 %b) !dbg !48 { +// CHECK:STDOUT: define i1 @_CTestLess.Main(i64 %a, i64 %b) !dbg !48 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.less = icmp ult i64 %a, %b, !dbg !49 // CHECK:STDOUT: ret i1 %int.less, !dbg !50 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestLessEq(i64 %a, i64 %b) !dbg !51 { +// CHECK:STDOUT: define i1 @_CTestLessEq.Main(i64 %a, i64 %b) !dbg !51 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.less_eq = icmp ule i64 %a, %b, !dbg !52 // CHECK:STDOUT: ret i1 %int.less_eq, !dbg !53 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestGreater(i64 %a, i64 %b) !dbg !54 { +// CHECK:STDOUT: define i1 @_CTestGreater.Main(i64 %a, i64 %b) !dbg !54 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.greater = icmp ugt i64 %a, %b, !dbg !55 // CHECK:STDOUT: ret i1 %int.greater, !dbg !56 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @TestGreaterEq(i64 %a, i64 %b) !dbg !57 { +// CHECK:STDOUT: define i1 @_CTestGreaterEq.Main(i64 %a, i64 %b) !dbg !57 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %int.greater_eq = icmp uge i64 %a, %b, !dbg !58 // CHECK:STDOUT: ret i1 %int.greater_eq, !dbg !59 @@ -180,59 +180,59 @@ 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", linkageName: "TestNegate", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "TestNegate", linkageName: "_CTestNegate.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 39, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 32, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestAdd", linkageName: "TestAdd", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestAdd", linkageName: "_CTestAdd.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 44, scope: !9) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 37, scope: !9) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "TestSub", linkageName: "TestSub", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "TestSub", linkageName: "_CTestSub.Main", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !13 = !DILocation(line: 18, column: 44, scope: !12) // CHECK:STDOUT: !14 = !DILocation(line: 18, column: 37, scope: !12) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "TestMul", linkageName: "TestMul", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "TestMul", linkageName: "_CTestMul.Main", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !16 = !DILocation(line: 21, column: 44, scope: !15) // CHECK:STDOUT: !17 = !DILocation(line: 21, column: 37, scope: !15) -// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "TestDiv", linkageName: "TestDiv", scope: null, file: !3, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !18 = distinct !DISubprogram(name: "TestDiv", linkageName: "_CTestDiv.Main", scope: null, file: !3, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !19 = !DILocation(line: 24, column: 44, scope: !18) // CHECK:STDOUT: !20 = !DILocation(line: 24, column: 37, scope: !18) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "TestMod", linkageName: "TestMod", scope: null, file: !3, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "TestMod", linkageName: "_CTestMod.Main", scope: null, file: !3, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !22 = !DILocation(line: 27, column: 44, scope: !21) // CHECK:STDOUT: !23 = !DILocation(line: 27, column: 37, scope: !21) -// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "TestComplement", linkageName: "TestComplement", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !24 = distinct !DISubprogram(name: "TestComplement", linkageName: "_CTestComplement.Main", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !25 = !DILocation(line: 30, column: 43, scope: !24) // CHECK:STDOUT: !26 = !DILocation(line: 30, column: 36, scope: !24) -// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "TestAnd", linkageName: "TestAnd", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !27 = distinct !DISubprogram(name: "TestAnd", linkageName: "_CTestAnd.Main", scope: null, file: !3, line: 33, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !28 = !DILocation(line: 33, column: 44, scope: !27) // CHECK:STDOUT: !29 = !DILocation(line: 33, column: 37, scope: !27) -// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "TestOr", linkageName: "TestOr", scope: null, file: !3, line: 36, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !30 = distinct !DISubprogram(name: "TestOr", linkageName: "_CTestOr.Main", scope: null, file: !3, line: 36, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !31 = !DILocation(line: 36, column: 43, scope: !30) // CHECK:STDOUT: !32 = !DILocation(line: 36, column: 36, scope: !30) -// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "TestXor", linkageName: "TestXor", scope: null, file: !3, line: 39, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !33 = distinct !DISubprogram(name: "TestXor", linkageName: "_CTestXor.Main", scope: null, file: !3, line: 39, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !34 = !DILocation(line: 39, column: 44, scope: !33) // CHECK:STDOUT: !35 = !DILocation(line: 39, column: 37, scope: !33) -// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "TestLeftShift", linkageName: "TestLeftShift", scope: null, file: !3, line: 42, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !36 = distinct !DISubprogram(name: "TestLeftShift", linkageName: "_CTestLeftShift.Main", scope: null, file: !3, line: 42, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !37 = !DILocation(line: 42, column: 50, scope: !36) // CHECK:STDOUT: !38 = !DILocation(line: 42, column: 43, scope: !36) -// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "TestRightShift", linkageName: "TestRightShift", scope: null, file: !3, line: 45, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !39 = distinct !DISubprogram(name: "TestRightShift", linkageName: "_CTestRightShift.Main", scope: null, file: !3, line: 45, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !40 = !DILocation(line: 45, column: 51, scope: !39) // CHECK:STDOUT: !41 = !DILocation(line: 45, column: 44, scope: !39) -// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "TestEq", linkageName: "TestEq", scope: null, file: !3, line: 48, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !42 = distinct !DISubprogram(name: "TestEq", linkageName: "_CTestEq.Main", scope: null, file: !3, line: 48, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !43 = !DILocation(line: 48, column: 44, scope: !42) // CHECK:STDOUT: !44 = !DILocation(line: 48, column: 37, scope: !42) -// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "TestNeq", linkageName: "TestNeq", scope: null, file: !3, line: 51, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !45 = distinct !DISubprogram(name: "TestNeq", linkageName: "_CTestNeq.Main", scope: null, file: !3, line: 51, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !46 = !DILocation(line: 51, column: 45, scope: !45) // CHECK:STDOUT: !47 = !DILocation(line: 51, column: 38, scope: !45) -// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "TestLess", linkageName: "TestLess", scope: null, file: !3, line: 54, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !48 = distinct !DISubprogram(name: "TestLess", linkageName: "_CTestLess.Main", scope: null, file: !3, line: 54, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !49 = !DILocation(line: 54, column: 46, scope: !48) // CHECK:STDOUT: !50 = !DILocation(line: 54, column: 39, scope: !48) -// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "TestLessEq", linkageName: "TestLessEq", scope: null, file: !3, line: 57, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !51 = distinct !DISubprogram(name: "TestLessEq", linkageName: "_CTestLessEq.Main", scope: null, file: !3, line: 57, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !52 = !DILocation(line: 57, column: 48, scope: !51) // CHECK:STDOUT: !53 = !DILocation(line: 57, column: 41, scope: !51) -// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "TestGreater", linkageName: "TestGreater", scope: null, file: !3, line: 60, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !54 = distinct !DISubprogram(name: "TestGreater", linkageName: "_CTestGreater.Main", scope: null, file: !3, line: 60, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !55 = !DILocation(line: 60, column: 49, scope: !54) // CHECK:STDOUT: !56 = !DILocation(line: 60, column: 42, scope: !54) -// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "TestGreaterEq", linkageName: "TestGreaterEq", scope: null, file: !3, line: 63, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !57 = distinct !DISubprogram(name: "TestGreaterEq", linkageName: "_CTestGreaterEq.Main", scope: null, file: !3, line: 63, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !58 = !DILocation(line: 63, column: 51, scope: !57) // CHECK:STDOUT: !59 = !DILocation(line: 63, column: 44, scope: !57) diff --git a/toolchain/lower/testdata/class/adapt.carbon b/toolchain/lower/testdata/class/adapt.carbon index 26e74311b3be..b51a4a961d39 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) !dbg !4 { +// CHECK:STDOUT: define void @_CMake.PairOfInts.Main(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, !dbg !7 // CHECK:STDOUT: %.loc9_27.4.b = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 @@ -64,24 +64,24 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Make.1(ptr sret({ i32, i32 }) %return) !dbg !9 { +// CHECK:STDOUT: define void @_CMake.PairAdapter.Main(ptr sret({ i32, i32 }) %return) !dbg !9 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @Make(ptr %return), !dbg !10 +// CHECK:STDOUT: call void @_CMake.PairOfInts.Main(ptr %return), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @GetB(ptr %self) !dbg !12 { +// CHECK:STDOUT: define i32 @_CGetB.PairAdapter.Main(ptr %self) !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc22_14.1.b = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !13 // CHECK:STDOUT: %.loc22_14.2 = load i32, ptr %.loc22_14.1.b, align 4, !dbg !13 // CHECK:STDOUT: ret i32 %.loc22_14.2, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Use() !dbg !15 { +// CHECK:STDOUT: define i32 @_CUse.Main() !dbg !15 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %pa.var = alloca { i32, i32 }, align 8, !dbg !16 -// CHECK:STDOUT: call void @Make.1(ptr %pa.var), !dbg !17 -// CHECK:STDOUT: %GetB.call = call i32 @GetB(ptr %pa.var), !dbg !18 +// CHECK:STDOUT: call void @_CMake.PairAdapter.Main(ptr %pa.var), !dbg !17 +// CHECK:STDOUT: %GetB.call = call i32 @_CGetB.PairAdapter.Main(ptr %pa.var), !dbg !18 // CHECK:STDOUT: ret i32 %GetB.call, !dbg !19 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -97,18 +97,18 @@ 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", linkageName: "Make", scope: null, file: !3, line: 8, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.PairOfInts.Main", scope: null, file: !3, line: 8, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 9, column: 12, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 9, column: 5, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Make", linkageName: "Make.1", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.PairAdapter.Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !10 = !DILocation(line: 17, column: 12, scope: !9) // CHECK:STDOUT: !11 = !DILocation(line: 17, column: 5, scope: !9) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "GetB", linkageName: "GetB", scope: null, file: !3, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "GetB", linkageName: "_CGetB.PairAdapter.Main", scope: null, file: !3, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !13 = !DILocation(line: 22, column: 12, scope: !12) // CHECK:STDOUT: !14 = !DILocation(line: 22, column: 5, scope: !12) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Use", linkageName: "Use", scope: null, file: !3, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Use", linkageName: "_CUse.Main", scope: null, file: !3, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !16 = !DILocation(line: 27, column: 7, scope: !15) // CHECK:STDOUT: !17 = !DILocation(line: 27, column: 25, scope: !15) // CHECK:STDOUT: !18 = !DILocation(line: 28, column: 10, scope: !15) @@ -116,7 +116,7 @@ fn DoStuff(a: Int) -> Int { // CHECK:STDOUT: ; ModuleID = 'adapt_int.carbon' // CHECK:STDOUT: source_filename = "adapt_int.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @DoStuff(i32 %a) !dbg !4 { +// CHECK:STDOUT: define i32 @_CDoStuff.Main(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 %a, !dbg !7 // CHECK:STDOUT: } @@ -128,7 +128,7 @@ 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", linkageName: "DoStuff", scope: null, file: !3, line: 8, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "DoStuff", linkageName: "_CDoStuff.Main", scope: null, file: !3, line: 8, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 9, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/class/base.carbon b/toolchain/lower/testdata/class/base.carbon index a5f7d4d38d91..b992df020138 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) !dbg !4 { +// CHECK:STDOUT: define void @_CMake.Main(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, !dbg !7 // CHECK:STDOUT: %.loc22_26.2.b = getelementptr inbounds nuw { i32 }, ptr %.loc22_35.2.base, i32 0, i32 0, !dbg !8 @@ -44,7 +44,7 @@ fn Convert(p: Derived*) -> Base* { // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Access(ptr sret({ i32, i32 }) %return, ptr %d) !dbg !10 { +// CHECK:STDOUT: define void @_CAccess.Main(ptr sret({ i32, i32 }) %return, ptr %d) !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc26_12.1.d = getelementptr inbounds nuw { { i32 }, i32 }, ptr %d, i32 0, i32 1, !dbg !11 // CHECK:STDOUT: %.loc26_12.2 = load i32, ptr %.loc26_12.1.d, align 4, !dbg !11 @@ -58,7 +58,7 @@ fn Convert(p: Derived*) -> Base* { // CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define ptr @Convert(ptr %p) !dbg !15 { +// CHECK:STDOUT: define ptr @_CConvert.Main(ptr %p) !dbg !15 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc30_11.2.base = getelementptr inbounds nuw { { i32 }, i32 }, ptr %p, i32 0, i32 0, !dbg !16 // CHECK:STDOUT: ret ptr %.loc30_11.2.base, !dbg !16 @@ -76,16 +76,16 @@ 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", linkageName: "Make", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 22, column: 10, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 22, column: 19, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 22, column: 3, scope: !4) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Access", linkageName: "Access", scope: null, file: !3, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Access", linkageName: "_CAccess.Main", scope: null, file: !3, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !11 = !DILocation(line: 26, column: 11, scope: !10) // CHECK:STDOUT: !12 = !DILocation(line: 26, column: 16, scope: !10) // CHECK:STDOUT: !13 = !DILocation(line: 26, column: 10, scope: !10) // CHECK:STDOUT: !14 = !DILocation(line: 26, column: 3, scope: !10) -// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Convert", linkageName: "Convert", scope: null, file: !3, line: 29, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.Main", scope: null, file: !3, line: 29, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !16 = !DILocation(line: 30, column: 3, scope: !15) diff --git a/toolchain/lower/testdata/class/basic.carbon b/toolchain/lower/testdata/class/basic.carbon index f3e3b0f6b0a5..97a1858eecb7 100644 --- a/toolchain/lower/testdata/class/basic.carbon +++ b/toolchain/lower/testdata/class/basic.carbon @@ -23,13 +23,13 @@ fn Run() { // CHECK:STDOUT: ; ModuleID = 'basic.carbon' // CHECK:STDOUT: source_filename = "basic.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: declare void @F(ptr sret({ i32, ptr }), ptr) +// CHECK:STDOUT: declare void @_CF.Main(ptr sret({ i32, ptr }), ptr) // CHECK:STDOUT: // CHECK:STDOUT: define void @main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %c.var = alloca { i32, ptr }, align 8, !dbg !7 // CHECK:STDOUT: %d.var = alloca { i32, ptr }, align 8, !dbg !8 -// CHECK:STDOUT: call void @F(ptr %d.var, ptr %c.var), !dbg !9 +// CHECK:STDOUT: call void @_CF.Main(ptr %d.var, ptr %c.var), !dbg !9 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/class/field.carbon b/toolchain/lower/testdata/class/field.carbon index 670cdfc593ad..720f401147fa 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) !dbg !4 { +// CHECK:STDOUT: define i32 @_CF.Main(ptr %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc17_13.1.b = getelementptr inbounds nuw { i32, ptr }, ptr %c, i32 0, i32 1, !dbg !7 // CHECK:STDOUT: %.loc17_13.2 = load ptr, ptr %.loc17_13.1.b, align 8, !dbg !7 @@ -43,7 +43,7 @@ fn Run() -> i32 { // CHECK:STDOUT: store i32 1, ptr %.loc22_4.a, align 4, !dbg !12 // CHECK:STDOUT: %.loc23_4.b = getelementptr inbounds nuw { i32, ptr }, ptr %c.var, i32 0, i32 1, !dbg !13 // CHECK:STDOUT: store ptr %c.var, ptr %.loc23_4.b, align 8, !dbg !13 -// CHECK:STDOUT: %F.call = call i32 @F(ptr %c.var), !dbg !14 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main(ptr %c.var), !dbg !14 // CHECK:STDOUT: ret i32 %F.call, !dbg !15 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -54,7 +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", linkageName: "F", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 17, column: 12, scope: !4) diff --git a/toolchain/lower/testdata/class/method.carbon b/toolchain/lower/testdata/class/method.carbon index 2769ab0f2c6f..c70b6c06938b 100644 --- a/toolchain/lower/testdata/class/method.carbon +++ b/toolchain/lower/testdata/class/method.carbon @@ -23,14 +23,14 @@ fn F(p: C*) { // CHECK:STDOUT: ; ModuleID = 'method.carbon' // CHECK:STDOUT: source_filename = "method.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: declare i32 @Get(ptr) +// CHECK:STDOUT: declare i32 @_CGet.C.Main(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: declare void @Set(ptr, i32) +// CHECK:STDOUT: declare void @_CSet.C.Main(ptr, i32) // CHECK:STDOUT: -// CHECK:STDOUT: define void @F(ptr %p) !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main(ptr %p) !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Get.call = call i32 @Get(ptr %p), !dbg !7 -// CHECK:STDOUT: call void @Set(ptr %p, i32 %Get.call), !dbg !8 +// CHECK:STDOUT: %Get.call = call i32 @_CGet.C.Main(ptr %p), !dbg !7 +// CHECK:STDOUT: call void @_CSet.C.Main(ptr %p, i32 %Get.call), !dbg !8 // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -41,7 +41,7 @@ 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", linkageName: "F", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 19, column: 16, scope: !4) diff --git a/toolchain/lower/testdata/class/self.carbon b/toolchain/lower/testdata/class/self.carbon index 55636f479d5e..40f2dc115df1 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) !dbg !4 { +// CHECK:STDOUT: define i32 @_CGet.C.Main(ptr %self) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc19_14.1.a = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !7 // CHECK:STDOUT: %.loc19_14.2 = load i32, ptr %.loc19_14.1.a, align 4, !dbg !7 // CHECK:STDOUT: ret i32 %.loc19_14.2, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Set(ptr %self) !dbg !9 { +// CHECK:STDOUT: define void @_CSet.C.Main(ptr %self) !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc23_10.a = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !10 // CHECK:STDOUT: store i32 1, ptr %.loc23_10.a, align 4, !dbg !10 @@ -47,11 +47,11 @@ 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", linkageName: "Get", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.C.Main", scope: null, file: !3, line: 18, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 19, column: 10, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 19, column: 3, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Set", linkageName: "Set", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Set", linkageName: "_CSet.C.Main", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !10 = !DILocation(line: 23, column: 3, scope: !9) // CHECK:STDOUT: !11 = !DILocation(line: 22, column: 1, scope: !9) diff --git a/toolchain/lower/testdata/class/value_access.carbon b/toolchain/lower/testdata/class/value_access.carbon index 8604499c6304..55c6a4364a2a 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) !dbg !4 { +// CHECK:STDOUT: define i32 @_CF.Main(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, !dbg !7 // CHECK:STDOUT: %.loc19_11.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %.loc19_11.1.a, i32 0, i32 0, !dbg !7 @@ -50,7 +50,7 @@ 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", linkageName: "F", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 19, column: 10, scope: !4) diff --git a/toolchain/lower/testdata/debug/nodebug.carbon b/toolchain/lower/testdata/debug/nodebug.carbon index d7c25618baf5..5450be65aecd 100644 --- a/toolchain/lower/testdata/debug/nodebug.carbon +++ b/toolchain/lower/testdata/debug/nodebug.carbon @@ -16,7 +16,7 @@ fn F() { // CHECK:STDOUT: ; ModuleID = 'nodebug.carbon' // CHECK:STDOUT: source_filename = "nodebug.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() { +// CHECK:STDOUT: define void @_CF.Main() { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void // CHECK:STDOUT: } diff --git a/toolchain/lower/testdata/function/call/empty_struct.carbon b/toolchain/lower/testdata/function/call/empty_struct.carbon index 56d9da938111..c320614ff2da 100644 --- a/toolchain/lower/testdata/function/call/empty_struct.carbon +++ b/toolchain/lower/testdata/function/call/empty_struct.carbon @@ -19,15 +19,15 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'empty_struct.carbon' // CHECK:STDOUT: source_filename = "empty_struct.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Echo() !dbg !4 { +// CHECK:STDOUT: define void @_CEcho.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca {}, align 8, !dbg !9 -// CHECK:STDOUT: call void @Echo(), !dbg !10 +// CHECK:STDOUT: call void @_CEcho.Main(), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -38,11 +38,11 @@ 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", linkageName: "Echo", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Echo", linkageName: "_CEcho.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 7, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 16, column: 15, scope: !8) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !8) diff --git a/toolchain/lower/testdata/function/call/empty_tuple.carbon b/toolchain/lower/testdata/function/call/empty_tuple.carbon index f79c32e899d7..c05c94f1d634 100644 --- a/toolchain/lower/testdata/function/call/empty_tuple.carbon +++ b/toolchain/lower/testdata/function/call/empty_tuple.carbon @@ -19,15 +19,15 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'empty_tuple.carbon' // CHECK:STDOUT: source_filename = "empty_tuple.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Echo() !dbg !4 { +// CHECK:STDOUT: define void @_CEcho.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca {}, align 8, !dbg !9 -// CHECK:STDOUT: call void @Echo(), !dbg !10 +// CHECK:STDOUT: call void @_CEcho.Main(), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -38,11 +38,11 @@ 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", linkageName: "Echo", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Echo", linkageName: "_CEcho.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 7, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 16, column: 15, scope: !8) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !8) diff --git a/toolchain/lower/testdata/function/call/i32.carbon b/toolchain/lower/testdata/function/call/i32.carbon index 3c15547d13de..3e4a9e4914a2 100644 --- a/toolchain/lower/testdata/function/call/i32.carbon +++ b/toolchain/lower/testdata/function/call/i32.carbon @@ -19,15 +19,15 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'i32.carbon' // CHECK:STDOUT: source_filename = "i32.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Echo(i32 %a) !dbg !4 { +// CHECK:STDOUT: define i32 @_CEcho.Main(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 %a, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca i32, align 4, !dbg !9 -// CHECK:STDOUT: %Echo.call = call i32 @Echo(i32 1), !dbg !10 +// CHECK:STDOUT: %Echo.call = call i32 @_CEcho.Main(i32 1), !dbg !10 // CHECK:STDOUT: store i32 %Echo.call, ptr %b.var, align 4, !dbg !11 // CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } @@ -39,11 +39,11 @@ 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", linkageName: "Echo", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Echo", linkageName: "_CEcho.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 7, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 16, column: 16, scope: !8) // CHECK:STDOUT: !11 = !DILocation(line: 16, column: 3, scope: !8) 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 f1ca435bf05f..c68cea9e8963 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,22 +20,22 @@ 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() !dbg !4 { +// CHECK:STDOUT: define void @_CFoo.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Bar() !dbg !8 { +// CHECK:STDOUT: define void @_CBar.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !10 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca {}, align 8, !dbg !11 -// CHECK:STDOUT: call void @Foo(), !dbg !12 +// CHECK:STDOUT: call void @_CFoo.Main(), !dbg !12 // CHECK:STDOUT: %.loc17_22.1.temp = alloca {}, align 8, !dbg !12 -// CHECK:STDOUT: call void @Bar(), !dbg !13 +// CHECK:STDOUT: call void @_CBar.Main(), !dbg !13 // CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -46,13 +46,13 @@ 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", linkageName: "Foo", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", linkageName: "_CFoo.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Bar", linkageName: "Bar", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Bar", linkageName: "_CBar.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 23, scope: !8) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !11 = !DILocation(line: 17, column: 7, scope: !10) // CHECK:STDOUT: !12 = !DILocation(line: 17, column: 19, scope: !10) // CHECK:STDOUT: !13 = !DILocation(line: 17, column: 15, scope: !10) diff --git a/toolchain/lower/testdata/function/call/params_one.carbon b/toolchain/lower/testdata/function/call/params_one.carbon index 5ab33ecca831..da5f946c7319 100644 --- a/toolchain/lower/testdata/function/call/params_one.carbon +++ b/toolchain/lower/testdata/function/call/params_one.carbon @@ -17,14 +17,14 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'params_one.carbon' // CHECK:STDOUT: source_filename = "params_one.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Foo(i32 %a) !dbg !4 { +// CHECK:STDOUT: define void @_CFoo.Main(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @Foo(i32 1), !dbg !9 +// CHECK:STDOUT: call void @_CFoo.Main(i32 1), !dbg !9 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -35,10 +35,10 @@ 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", linkageName: "Foo", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", linkageName: "_CFoo.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 3, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 13, column: 1, scope: !8) diff --git a/toolchain/lower/testdata/function/call/params_one_comma.carbon b/toolchain/lower/testdata/function/call/params_one_comma.carbon index 7855e9fa03ff..267c93bf89c0 100644 --- a/toolchain/lower/testdata/function/call/params_one_comma.carbon +++ b/toolchain/lower/testdata/function/call/params_one_comma.carbon @@ -18,15 +18,15 @@ 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) !dbg !4 { +// CHECK:STDOUT: define void @_CFoo.Main(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @Foo(i32 1), !dbg !9 -// CHECK:STDOUT: call void @Foo(i32 1), !dbg !10 +// CHECK:STDOUT: call void @_CFoo.Main(i32 1), !dbg !9 +// CHECK:STDOUT: call void @_CFoo.Main(i32 1), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -37,11 +37,11 @@ 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", linkageName: "Foo", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", linkageName: "_CFoo.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 3, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 3, scope: !8) // CHECK:STDOUT: !11 = !DILocation(line: 13, column: 1, scope: !8) diff --git a/toolchain/lower/testdata/function/call/params_two.carbon b/toolchain/lower/testdata/function/call/params_two.carbon index fa1f2275a7b0..06ffd7467bef 100644 --- a/toolchain/lower/testdata/function/call/params_two.carbon +++ b/toolchain/lower/testdata/function/call/params_two.carbon @@ -17,14 +17,14 @@ 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) !dbg !4 { +// CHECK:STDOUT: define void @_CFoo.Main(i32 %a, i32 %b) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @Foo(i32 1, i32 2), !dbg !9 +// CHECK:STDOUT: call void @_CFoo.Main(i32 1, i32 2), !dbg !9 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -35,10 +35,10 @@ 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", linkageName: "Foo", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", linkageName: "_CFoo.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 3, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 13, column: 1, scope: !8) diff --git a/toolchain/lower/testdata/function/call/params_two_comma.carbon b/toolchain/lower/testdata/function/call/params_two_comma.carbon index 871eee2ca5a6..b3137f22b323 100644 --- a/toolchain/lower/testdata/function/call/params_two_comma.carbon +++ b/toolchain/lower/testdata/function/call/params_two_comma.carbon @@ -18,15 +18,15 @@ 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) !dbg !4 { +// CHECK:STDOUT: define void @_CFoo.Main(i32 %a, i32 %b) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @Foo(i32 1, i32 2), !dbg !9 -// CHECK:STDOUT: call void @Foo(i32 1, i32 2), !dbg !10 +// CHECK:STDOUT: call void @_CFoo.Main(i32 1, i32 2), !dbg !9 +// CHECK:STDOUT: call void @_CFoo.Main(i32 1, i32 2), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -37,11 +37,11 @@ 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", linkageName: "Foo", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", linkageName: "_CFoo.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 3, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 3, scope: !8) // CHECK:STDOUT: !11 = !DILocation(line: 13, column: 1, scope: !8) diff --git a/toolchain/lower/testdata/function/call/params_zero.carbon b/toolchain/lower/testdata/function/call/params_zero.carbon index 42114b82b829..26a6884ef6d4 100644 --- a/toolchain/lower/testdata/function/call/params_zero.carbon +++ b/toolchain/lower/testdata/function/call/params_zero.carbon @@ -17,14 +17,14 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'params_zero.carbon' // CHECK:STDOUT: source_filename = "params_zero.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Foo() !dbg !4 { +// CHECK:STDOUT: define void @_CFoo.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @Foo(), !dbg !9 +// CHECK:STDOUT: call void @_CFoo.Main(), !dbg !9 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -35,10 +35,10 @@ 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", linkageName: "Foo", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", linkageName: "_CFoo.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 3, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 13, column: 1, scope: !8) diff --git a/toolchain/lower/testdata/function/call/return_implicit.carbon b/toolchain/lower/testdata/function/call/return_implicit.carbon index 7f9669e4731c..a1e3c1a51126 100644 --- a/toolchain/lower/testdata/function/call/return_implicit.carbon +++ b/toolchain/lower/testdata/function/call/return_implicit.carbon @@ -19,15 +19,15 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'return_implicit.carbon' // CHECK:STDOUT: source_filename = "return_implicit.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @MakeImplicitEmptyTuple() !dbg !4 { +// CHECK:STDOUT: define void @_CMakeImplicitEmptyTuple.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %b.var = alloca {}, align 8, !dbg !9 -// CHECK:STDOUT: call void @MakeImplicitEmptyTuple(), !dbg !10 +// CHECK:STDOUT: call void @_CMakeImplicitEmptyTuple.Main(), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -38,11 +38,11 @@ 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", linkageName: "MakeImplicitEmptyTuple", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "MakeImplicitEmptyTuple", linkageName: "_CMakeImplicitEmptyTuple.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 7, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 16, column: 15, scope: !8) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 1, scope: !8) diff --git a/toolchain/lower/testdata/function/call/struct_param.carbon b/toolchain/lower/testdata/function/call/struct_param.carbon index 2cf59d120afb..c7e0ef7f6745 100644 --- a/toolchain/lower/testdata/function/call/struct_param.carbon +++ b/toolchain/lower/testdata/function/call/struct_param.carbon @@ -19,14 +19,14 @@ 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) !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main({ i32 } %b, ptr %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @F({ i32 } { i32 1 }, ptr @struct.3.loc14_4.3), !dbg !9 +// CHECK:STDOUT: call void @_CF.Main({ i32 } { i32 1 }, ptr @struct.3.loc14_4.3), !dbg !9 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -37,10 +37,10 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 3, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 13, column: 1, scope: !8) diff --git a/toolchain/lower/testdata/function/call/tuple_param.carbon b/toolchain/lower/testdata/function/call/tuple_param.carbon index 1b33d29ece49..5ad45eaf9e73 100644 --- a/toolchain/lower/testdata/function/call/tuple_param.carbon +++ b/toolchain/lower/testdata/function/call/tuple_param.carbon @@ -19,14 +19,14 @@ 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) !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main({ i32 } %b, ptr %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @F({ i32 } { i32 1 }, ptr @tuple.3.loc14_4.3), !dbg !9 +// CHECK:STDOUT: call void @_CF.Main({ i32 } { i32 1 }, ptr @tuple.3.loc14_4.3), !dbg !9 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -37,10 +37,10 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 3, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 13, column: 1, scope: !8) 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 02d943490641..4a164beea3b4 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) !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main(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, !dbg !7 // CHECK:STDOUT: %.loc12_17.tuple.index = getelementptr inbounds nuw { i32, i32 }, ptr %c, i32 0, i32 0, !dbg !8 @@ -37,10 +37,10 @@ fn Main() { // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !12 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc16_4.1.temp = alloca { i32, i32, i32 }, align 8, !dbg !13 -// CHECK:STDOUT: call void @F(ptr %.loc16_4.1.temp, { i32 } { i32 1 }, ptr @tuple.3.loc16_4.4), !dbg !13 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc16_4.1.temp, { i32 } { i32 1 }, ptr @tuple.3.loc16_4.4), !dbg !13 // CHECK:STDOUT: ret void, !dbg !14 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -54,7 +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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 11, scope: !4) @@ -62,6 +62,6 @@ fn Main() { // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 21, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 12, column: 10, scope: !4) // CHECK:STDOUT: !11 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !13 = !DILocation(line: 16, column: 3, scope: !12) // CHECK:STDOUT: !14 = !DILocation(line: 15, column: 1, scope: !12) diff --git a/toolchain/lower/testdata/function/call/var_param.carbon b/toolchain/lower/testdata/function/call/var_param.carbon index 1e2b97ba4668..0ebccd348889 100644 --- a/toolchain/lower/testdata/function/call/var_param.carbon +++ b/toolchain/lower/testdata/function/call/var_param.carbon @@ -18,17 +18,17 @@ fn Main() { // CHECK:STDOUT: ; ModuleID = 'var_param.carbon' // CHECK:STDOUT: source_filename = "var_param.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @DoNothing(i32 %a) !dbg !4 { +// CHECK:STDOUT: define void @_CDoNothing.Main(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !9 // CHECK:STDOUT: store i32 0, ptr %a.var, align 4, !dbg !10 // CHECK:STDOUT: %.loc15 = load i32, ptr %a.var, align 4, !dbg !11 -// CHECK:STDOUT: call void @DoNothing(i32 %.loc15), !dbg !12 +// CHECK:STDOUT: call void @_CDoNothing.Main(i32 %.loc15), !dbg !12 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -39,11 +39,11 @@ 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", linkageName: "DoNothing", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "DoNothing", linkageName: "_CDoNothing.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 7, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 14, column: 3, scope: !8) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 13, scope: !8) diff --git a/toolchain/lower/testdata/function/declaration/simple.carbon b/toolchain/lower/testdata/function/declaration/simple.carbon index 21a4aa4745f9..6b5f82ba6edd 100644 --- a/toolchain/lower/testdata/function/declaration/simple.carbon +++ b/toolchain/lower/testdata/function/declaration/simple.carbon @@ -15,11 +15,11 @@ fn G(n: i32) { F(n); } // CHECK:STDOUT: ; ModuleID = 'simple.carbon' // CHECK:STDOUT: source_filename = "simple.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: declare void @F(i32) +// CHECK:STDOUT: declare void @_CF.Main(i32) // CHECK:STDOUT: -// CHECK:STDOUT: define void @G(i32 %n) !dbg !4 { +// CHECK:STDOUT: define void @_CG.Main(i32 %n) !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @F(i32 %n), !dbg !7 +// CHECK:STDOUT: call void @_CF.Main(i32 %n), !dbg !7 // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -30,7 +30,7 @@ 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", linkageName: "G", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 13, column: 16, scope: !4) diff --git a/toolchain/lower/testdata/function/definition/empty_struct.carbon b/toolchain/lower/testdata/function/definition/empty_struct.carbon index 19fab4912ff2..62b6f3e5e3e8 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() !dbg !4 { +// CHECK:STDOUT: define void @_CEcho.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } @@ -26,7 +26,7 @@ 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", linkageName: "Echo", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Echo", linkageName: "_CEcho.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/function/definition/params_one.carbon b/toolchain/lower/testdata/function/definition/params_one.carbon index 0ffe22f00391..81b438967618 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) !dbg !4 { +// CHECK:STDOUT: define void @_CFoo.Main(i32 %a) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } @@ -25,7 +25,7 @@ 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", linkageName: "Foo", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", linkageName: "_CFoo.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/function/definition/params_two.carbon b/toolchain/lower/testdata/function/definition/params_two.carbon index 23322afc2473..2ade1989c27b 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) !dbg !4 { +// CHECK:STDOUT: define void @_CFoo.Main(i32 %a, i32 %b) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } @@ -25,7 +25,7 @@ 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", linkageName: "Foo", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", linkageName: "_CFoo.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/function/definition/params_zero.carbon b/toolchain/lower/testdata/function/definition/params_zero.carbon index 0bc600ff6269..3faed3f0c4f6 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() !dbg !4 { +// CHECK:STDOUT: define void @_CFoo.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } @@ -25,7 +25,7 @@ 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", linkageName: "Foo", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Foo", linkageName: "_CFoo.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/function/definition/raw_name.carbon b/toolchain/lower/testdata/function/definition/raw_name.carbon index 7737ab7493ce..b25e5b7bd1be 100644 --- a/toolchain/lower/testdata/function/definition/raw_name.carbon +++ b/toolchain/lower/testdata/function/definition/raw_name.carbon @@ -14,7 +14,7 @@ fn r#self() {} // CHECK:STDOUT: ; ModuleID = 'raw_name.carbon' // CHECK:STDOUT: source_filename = "raw_name.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @self() !dbg !4 { +// CHECK:STDOUT: define void @_Cself.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } @@ -26,7 +26,7 @@ fn r#self() {} // 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: "raw_name.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "self", linkageName: "self", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "self", linkageName: "_Cself.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/global/class_obj.carbon b/toolchain/lower/testdata/global/class_obj.carbon index 3388d87b7cf6..00d3ed5d6284 100644 --- a/toolchain/lower/testdata/global/class_obj.carbon +++ b/toolchain/lower/testdata/global/class_obj.carbon @@ -16,9 +16,9 @@ var a: A = {}; // CHECK:STDOUT: // CHECK:STDOUT: @a = internal global {} // 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: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] // CHECK:STDOUT: -// CHECK:STDOUT: define void @__global_init() !dbg !4 { +// CHECK:STDOUT: define void @_C__global_init.Main() !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), !dbg !7 // CHECK:STDOUT: ret void, !dbg !8 @@ -36,7 +36,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_obj.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "__global_init", linkageName: "__global_init", scope: null, file: !3, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !3, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/global/class_with_fun.carbon b/toolchain/lower/testdata/global/class_with_fun.carbon index 28ab6e829ff0..c0570446d2f3 100644 --- a/toolchain/lower/testdata/global/class_with_fun.carbon +++ b/toolchain/lower/testdata/global/class_with_fun.carbon @@ -21,15 +21,15 @@ var a: A = {}; // CHECK:STDOUT: @a = internal global {} // CHECK:STDOUT: @struct.loc13_12 = internal constant {} zeroinitializer // 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: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] // CHECK:STDOUT: -// CHECK:STDOUT: define void @ret_a(ptr sret({}) %return) !dbg !4 { +// CHECK:STDOUT: define void @_Cret_a.Main(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), !dbg !7 // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @__global_init() !dbg !8 { +// CHECK:STDOUT: define void @_C__global_init.Main() !dbg !8 { // 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), !dbg !9 // CHECK:STDOUT: ret void, !dbg !10 @@ -50,10 +50,10 @@ 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", linkageName: "ret_a", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "ret_a", linkageName: "_Cret_a.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 13, column: 3, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "__global_init", linkageName: "__global_init", scope: null, file: !3, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !3, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 16, column: 1, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 0, scope: !8) diff --git a/toolchain/lower/testdata/global/simple_init.carbon b/toolchain/lower/testdata/global/simple_init.carbon index 231e11e20893..6591ab48b3df 100644 --- a/toolchain/lower/testdata/global/simple_init.carbon +++ b/toolchain/lower/testdata/global/simple_init.carbon @@ -13,9 +13,9 @@ var a: i32 = 0; // CHECK:STDOUT: source_filename = "simple_init.carbon" // CHECK:STDOUT: // 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: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] // CHECK:STDOUT: -// CHECK:STDOUT: define void @__global_init() !dbg !4 { +// CHECK:STDOUT: define void @_C__global_init.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: store i32 0, ptr @a, align 4, !dbg !7 // CHECK:STDOUT: ret void, !dbg !8 @@ -31,7 +31,7 @@ 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", linkageName: "__global_init", scope: null, file: !3, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !3, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 10, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/global/simple_with_fun.carbon b/toolchain/lower/testdata/global/simple_with_fun.carbon index f1ff64fb42a2..761b9abb0261 100644 --- a/toolchain/lower/testdata/global/simple_with_fun.carbon +++ b/toolchain/lower/testdata/global/simple_with_fun.carbon @@ -18,16 +18,16 @@ var a: i32 = test_a(); // CHECK:STDOUT: source_filename = "simple_with_fun.carbon" // CHECK:STDOUT: // 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: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @_C__global_init.Main, ptr null }] // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @test_a() !dbg !4 { +// CHECK:STDOUT: define i32 @_Ctest_a.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @__global_init() !dbg !8 { +// CHECK:STDOUT: define void @_C__global_init.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %test_a.call = call i32 @test_a(), !dbg !9 +// CHECK:STDOUT: %test_a.call = call i32 @_Ctest_a.Main(), !dbg !9 // CHECK:STDOUT: store i32 %test_a.call, ptr @a, align 4, !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } @@ -42,11 +42,11 @@ 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", linkageName: "test_a", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "test_a", linkageName: "_Ctest_a.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "__global_init", linkageName: "__global_init", scope: null, file: !3, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "__global_init", linkageName: "_C__global_init.Main", scope: null, file: !3, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 15, column: 14, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 15, column: 1, scope: !8) // CHECK:STDOUT: !11 = !DILocation(line: 0, scope: !8) diff --git a/toolchain/lower/testdata/if/else.carbon b/toolchain/lower/testdata/if/else.carbon index 567f88fbebd4..0bf402bef0ad 100644 --- a/toolchain/lower/testdata/if/else.carbon +++ b/toolchain/lower/testdata/if/else.carbon @@ -24,35 +24,35 @@ fn If(b: bool) { // CHECK:STDOUT: ; ModuleID = 'else.carbon' // CHECK:STDOUT: source_filename = "else.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() !dbg !8 { +// CHECK:STDOUT: define void @_CG.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @H() !dbg !10 { +// CHECK:STDOUT: define void @_CH.Main() !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @If(i1 %b) !dbg !12 { +// CHECK:STDOUT: define void @_CIf.Main(i1 %b) !dbg !12 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br i1 %b, label %if.then, label %if.else, !dbg !13 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: call void @F(), !dbg !14 +// CHECK:STDOUT: call void @_CF.Main(), !dbg !14 // CHECK:STDOUT: br label %if.done, !dbg !15 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %entry -// CHECK:STDOUT: call void @G(), !dbg !16 +// CHECK:STDOUT: call void @_CG.Main(), !dbg !16 // CHECK:STDOUT: br label %if.done, !dbg !15 // CHECK:STDOUT: // CHECK:STDOUT: if.done: ; preds = %if.else, %if.then -// CHECK:STDOUT: call void @H(), !dbg !17 +// CHECK:STDOUT: call void @_CH.Main(), !dbg !17 // CHECK:STDOUT: ret void, !dbg !18 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -63,15 +63,15 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "G", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 1, scope: !8) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "H", linkageName: "H", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !11 = !DILocation(line: 13, column: 1, scope: !10) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "If", linkageName: "If", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "If", linkageName: "_CIf.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !13 = !DILocation(line: 16, column: 6, scope: !12) // CHECK:STDOUT: !14 = !DILocation(line: 17, column: 5, scope: !12) // CHECK:STDOUT: !15 = !DILocation(line: 16, column: 3, scope: !12) diff --git a/toolchain/lower/testdata/if/no_else.carbon b/toolchain/lower/testdata/if/no_else.carbon index a95c0e1e6e4c..21b9cbc7b6b1 100644 --- a/toolchain/lower/testdata/if/no_else.carbon +++ b/toolchain/lower/testdata/if/no_else.carbon @@ -21,26 +21,26 @@ fn If(b: bool) { // CHECK:STDOUT: ; ModuleID = 'no_else.carbon' // CHECK:STDOUT: source_filename = "no_else.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() !dbg !8 { +// CHECK:STDOUT: define void @_CG.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @If(i1 %b) !dbg !10 { +// CHECK:STDOUT: define void @_CIf.Main(i1 %b) !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br i1 %b, label %if.then, label %if.else, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: if.then: ; preds = %entry -// CHECK:STDOUT: call void @F(), !dbg !12 +// CHECK:STDOUT: call void @_CF.Main(), !dbg !12 // CHECK:STDOUT: br label %if.else, !dbg !13 // CHECK:STDOUT: // CHECK:STDOUT: if.else: ; preds = %if.then, %entry -// CHECK:STDOUT: call void @G(), !dbg !14 +// CHECK:STDOUT: call void @_CG.Main(), !dbg !14 // CHECK:STDOUT: ret void, !dbg !15 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -51,13 +51,13 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "G", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 1, scope: !8) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "If", linkageName: "If", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "If", linkageName: "_CIf.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 6, scope: !10) // CHECK:STDOUT: !12 = !DILocation(line: 16, column: 5, scope: !10) // CHECK:STDOUT: !13 = !DILocation(line: 15, column: 3, scope: !10) diff --git a/toolchain/lower/testdata/if_expr/basic.carbon b/toolchain/lower/testdata/if_expr/basic.carbon index e2f814687cc5..919be2d4f742 100644 --- a/toolchain/lower/testdata/if_expr/basic.carbon +++ b/toolchain/lower/testdata/if_expr/basic.carbon @@ -18,26 +18,26 @@ fn Select(b: bool) -> i32 { // CHECK:STDOUT: ; ModuleID = 'basic.carbon' // CHECK:STDOUT: source_filename = "basic.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F() !dbg !4 { +// CHECK:STDOUT: define i32 @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 1, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @G() !dbg !8 { +// CHECK:STDOUT: define i32 @_CG.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 2, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Select(i1 %b) !dbg !10 { +// CHECK:STDOUT: define i32 @_CSelect.Main(i1 %b) !dbg !10 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br i1 %b, label %if.expr.then, label %if.expr.else, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: if.expr.then: ; preds = %entry -// CHECK:STDOUT: %F.call = call i32 @F(), !dbg !12 +// CHECK:STDOUT: %F.call = call i32 @_CF.Main(), !dbg !12 // CHECK:STDOUT: br label %if.expr.result, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: if.expr.else: ; preds = %entry -// CHECK:STDOUT: %G.call = call i32 @G(), !dbg !13 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main(), !dbg !13 // CHECK:STDOUT: br label %if.expr.result, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: if.expr.result: ; preds = %if.expr.else, %if.expr.then @@ -52,13 +52,13 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 17, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "G", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 17, scope: !8) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Select", linkageName: "Select", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Select", linkageName: "_CSelect.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 10, scope: !10) // CHECK:STDOUT: !12 = !DILocation(line: 15, column: 20, scope: !10) // CHECK:STDOUT: !13 = !DILocation(line: 15, column: 29, scope: !10) diff --git a/toolchain/lower/testdata/if_expr/empty_block.carbon b/toolchain/lower/testdata/if_expr/empty_block.carbon index fda57da20c9d..fb3e33cfb415 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) !dbg !4 { +// CHECK:STDOUT: define i32 @_CSelect.Main(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, !dbg !7 // CHECK:STDOUT: @@ -57,7 +57,7 @@ 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", linkageName: "Select", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Select", linkageName: "_CSelect.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 10, scope: !4) diff --git a/toolchain/lower/testdata/impl/assoc_fn_alias.carbon b/toolchain/lower/testdata/impl/assoc_fn_alias.carbon index 46eb2091ba3e..0da3a2fe68de 100644 --- a/toolchain/lower/testdata/impl/assoc_fn_alias.carbon +++ b/toolchain/lower/testdata/impl/assoc_fn_alias.carbon @@ -30,16 +30,16 @@ 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) !dbg !4 { +// CHECK:STDOUT: define i32 @"_CF.A.Main:I.Main"(ptr %self) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc22_16.1.n = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !7 // CHECK:STDOUT: %.loc22_16.2 = load i32, ptr %.loc22_16.1.n, align 4, !dbg !7 // CHECK:STDOUT: ret i32 %.loc22_16.2, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Call(ptr %a) !dbg !9 { +// CHECK:STDOUT: define i32 @_CCall.Main(ptr %a) !dbg !9 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call i32 @F(ptr %a), !dbg !10 +// CHECK:STDOUT: %F.call = call i32 @"_CF.A.Main:I.Main"(ptr %a), !dbg !10 // CHECK:STDOUT: ret i32 %F.call, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -50,11 +50,11 @@ 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", linkageName: "F", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.A.Main:I.Main", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 22, column: 12, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 22, column: 5, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Call", linkageName: "Call", scope: null, file: !3, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !3, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !10 = !DILocation(line: 27, column: 10, scope: !9) // CHECK:STDOUT: !11 = !DILocation(line: 27, column: 3, scope: !9) diff --git a/toolchain/lower/testdata/impl/extend_impl.carbon b/toolchain/lower/testdata/impl/extend_impl.carbon index 9e2b3799470f..9583cac774df 100644 --- a/toolchain/lower/testdata/impl/extend_impl.carbon +++ b/toolchain/lower/testdata/impl/extend_impl.carbon @@ -31,20 +31,20 @@ 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() !dbg !4 { +// CHECK:STDOUT: define i32 @"_CF.A.Main:I.Main"() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @TypeAccess() !dbg !8 { +// CHECK:STDOUT: define i32 @_CTypeAccess.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call i32 @F(), !dbg !9 +// CHECK:STDOUT: %F.call = call i32 @"_CF.A.Main:I.Main"(), !dbg !9 // CHECK:STDOUT: ret i32 %F.call, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @InstanceAccess(ptr %a) !dbg !11 { +// CHECK:STDOUT: define i32 @_CInstanceAccess.Main(ptr %a) !dbg !11 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call i32 @F(), !dbg !12 +// CHECK:STDOUT: %F.call = call i32 @"_CF.A.Main:I.Main"(), !dbg !12 // CHECK:STDOUT: ret i32 %F.call, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -55,13 +55,13 @@ 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", linkageName: "F", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.A.Main:I.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 18, column: 7, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "TypeAccess", linkageName: "TypeAccess", scope: null, file: !3, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "TypeAccess", linkageName: "_CTypeAccess.Main", scope: null, file: !3, line: 23, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 24, column: 10, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 24, column: 3, scope: !8) -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "InstanceAccess", linkageName: "InstanceAccess", scope: null, file: !3, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "InstanceAccess", linkageName: "_CInstanceAccess.Main", scope: null, file: !3, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !12 = !DILocation(line: 28, column: 10, scope: !11) // CHECK:STDOUT: !13 = !DILocation(line: 28, column: 3, scope: !11) diff --git a/toolchain/lower/testdata/impl/impl.carbon b/toolchain/lower/testdata/impl/impl.carbon index 060c07a290c2..ff653b26b811 100644 --- a/toolchain/lower/testdata/impl/impl.carbon +++ b/toolchain/lower/testdata/impl/impl.carbon @@ -29,16 +29,16 @@ 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) !dbg !4 { +// CHECK:STDOUT: define i32 @"_CF.A.Main:I.Main"(ptr %self) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc21_16.1.n = getelementptr inbounds nuw { i32 }, ptr %self, i32 0, i32 0, !dbg !7 // CHECK:STDOUT: %.loc21_16.2 = load i32, ptr %.loc21_16.1.n, align 4, !dbg !7 // CHECK:STDOUT: ret i32 %.loc21_16.2, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @Call(ptr %a) !dbg !9 { +// CHECK:STDOUT: define i32 @_CCall.Main(ptr %a) !dbg !9 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call i32 @F(ptr %a), !dbg !10 +// CHECK:STDOUT: %F.call = call i32 @"_CF.A.Main:I.Main"(ptr %a), !dbg !10 // CHECK:STDOUT: ret i32 %F.call, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -49,11 +49,11 @@ 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", linkageName: "F", scope: null, file: !3, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.A.Main:I.Main", scope: null, file: !3, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 21, column: 12, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 21, column: 5, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Call", linkageName: "Call", scope: null, file: !3, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !3, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !10 = !DILocation(line: 26, column: 10, scope: !9) // CHECK:STDOUT: !11 = !DILocation(line: 26, column: 3, scope: !9) diff --git a/toolchain/lower/testdata/impl/instance_method.carbon b/toolchain/lower/testdata/impl/instance_method.carbon index c6c20f0fe98d..62947f7d0115 100644 --- a/toolchain/lower/testdata/impl/instance_method.carbon +++ b/toolchain/lower/testdata/impl/instance_method.carbon @@ -29,14 +29,14 @@ 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) !dbg !4 { +// CHECK:STDOUT: define ptr @"_CGet.A.Main:GetSelf.Main"(ptr %self) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret ptr %self, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define ptr @Call(ptr %a) !dbg !8 { +// CHECK:STDOUT: define ptr @_CCall.Main(ptr %a) !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %Get.call = call ptr @Get(ptr %a), !dbg !9 +// CHECK:STDOUT: %Get.call = call ptr @"_CGet.A.Main:GetSelf.Main"(ptr %a), !dbg !9 // CHECK:STDOUT: ret ptr %Get.call, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -47,10 +47,10 @@ 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", linkageName: "Get", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.A.Main:GetSelf.Main", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 20, column: 7, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Call", linkageName: "Call", scope: null, file: !3, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Call", linkageName: "_CCall.Main", scope: null, file: !3, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 26, column: 10, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 26, column: 3, scope: !8) diff --git a/toolchain/lower/testdata/index/array_element_access.carbon b/toolchain/lower/testdata/index/array_element_access.carbon index 20ee6928f201..ca4ed8469e09 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) !dbg !4 { +// CHECK:STDOUT: define void @_CA.Main(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, !dbg !7 // CHECK:STDOUT: %.loc10_36.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 @@ -32,7 +32,7 @@ fn Run() { // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @B(ptr sret([2 x i32]) %return) !dbg !9 { +// CHECK:STDOUT: define void @_CB.Main(ptr sret([2 x i32]) %return) !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12_34.3.array.index = getelementptr inbounds [2 x i32], ptr %return, i32 0, i32 0, !dbg !10 // CHECK:STDOUT: %.loc12_34.6.array.index = getelementptr inbounds [2 x i32], ptr %return, i32 0, i32 1, !dbg !10 @@ -44,7 +44,7 @@ fn Run() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca [2 x i32], align 4, !dbg !13 // CHECK:STDOUT: %.loc15_22.1.temp = alloca { i32, i32 }, align 8, !dbg !14 -// CHECK:STDOUT: call void @A(ptr %.loc15_22.1.temp), !dbg !14 +// CHECK:STDOUT: call void @_CA.Main(ptr %.loc15_22.1.temp), !dbg !14 // CHECK:STDOUT: %.loc15_22.3.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %.loc15_22.1.temp, i32 0, i32 0, !dbg !14 // CHECK:STDOUT: %.loc15_22.4 = load i32, ptr %.loc15_22.3.tuple.elem, align 4, !dbg !14 // CHECK:STDOUT: %.loc15_22.6.array.index = getelementptr inbounds [2 x i32], ptr %a.var, i32 0, i32 0, !dbg !14 @@ -62,7 +62,7 @@ fn Run() { // CHECK:STDOUT: store i32 %.loc17_19.2, ptr %c.var, align 4, !dbg !20 // CHECK:STDOUT: %d.var = alloca i32, align 4, !dbg !21 // CHECK:STDOUT: %.loc18_17.1.temp = alloca [2 x i32], align 4, !dbg !22 -// CHECK:STDOUT: call void @B(ptr %.loc18_17.1.temp), !dbg !22 +// CHECK:STDOUT: call void @_CB.Main(ptr %.loc18_17.1.temp), !dbg !22 // CHECK:STDOUT: %.loc18_21.1.array.index = getelementptr inbounds [2 x i32], ptr %.loc18_17.1.temp, i32 0, i32 1, !dbg !22 // CHECK:STDOUT: %.loc18_21.2 = load i32, ptr %.loc18_21.1.array.index, align 4, !dbg !22 // CHECK:STDOUT: store i32 %.loc18_21.2, ptr %d.var, align 4, !dbg !23 @@ -84,12 +84,12 @@ 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", linkageName: "A", scope: null, file: !3, line: 10, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "A", linkageName: "_CA.Main", scope: null, file: !3, line: 10, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 10, column: 31, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 10, column: 24, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "B", linkageName: "B", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "B", linkageName: "_CB.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !10 = !DILocation(line: 12, column: 29, scope: !9) // CHECK:STDOUT: !11 = !DILocation(line: 12, column: 22, scope: !9) // CHECK:STDOUT: !12 = distinct !DISubprogram(name: "Run", linkageName: "main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) diff --git a/toolchain/lower/testdata/interface/assoc.carbon b/toolchain/lower/testdata/interface/assoc.carbon index 5c4881024cea..b79d1b9c6d9f 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() !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } @@ -29,7 +29,7 @@ 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", linkageName: "F", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 15, column: 1, scope: !4) diff --git a/toolchain/lower/testdata/interface/basic.carbon b/toolchain/lower/testdata/interface/basic.carbon index 1f9062e2b531..68dc97cabeb0 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() !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() !dbg !8 { +// CHECK:STDOUT: define void @_CG.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } @@ -41,9 +41,9 @@ 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", linkageName: "F", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 17, column: 19, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "G", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 22, column: 1, scope: !8) diff --git a/toolchain/lower/testdata/let/tuple.carbon b/toolchain/lower/testdata/let/tuple.carbon index 3cb4f9b23b79..d2a5995302e8 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() !dbg !4 { +// CHECK:STDOUT: define i32 @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8, !dbg !7 // CHECK:STDOUT: %.loc12_36.2.tuple.elem = getelementptr inbounds nuw { i32, i32, i32 }, ptr %a.var, i32 0, i32 0, !dbg !8 @@ -81,7 +81,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: "tuple.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/namespace/function.carbon b/toolchain/lower/testdata/namespace/function.carbon index f8121b0702e4..f8bf1a3410a1 100644 --- a/toolchain/lower/testdata/namespace/function.carbon +++ b/toolchain/lower/testdata/namespace/function.carbon @@ -24,19 +24,19 @@ fn Bar() { // CHECK:STDOUT: ; ModuleID = 'function.carbon' // CHECK:STDOUT: source_filename = "function.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Baz() !dbg !4 { +// CHECK:STDOUT: define void @_CBaz.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Baz.1() !dbg !8 { +// CHECK:STDOUT: define void @_CBaz.Foo.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Bar() !dbg !10 { +// CHECK:STDOUT: define void @_CBar.Main() !dbg !10 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @Baz.1(), !dbg !11 +// CHECK:STDOUT: call void @_CBaz.Foo.Main(), !dbg !11 // CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -47,12 +47,12 @@ 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", linkageName: "Baz", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Baz", linkageName: "_CBaz.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Baz", linkageName: "Baz.1", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Baz", linkageName: "_CBaz.Foo.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 17, column: 1, scope: !8) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Bar", linkageName: "Bar", scope: null, file: !3, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Bar", linkageName: "_CBar.Main", scope: null, file: !3, line: 20, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !11 = !DILocation(line: 21, column: 3, scope: !10) // CHECK:STDOUT: !12 = !DILocation(line: 20, column: 1, scope: !10) diff --git a/toolchain/lower/testdata/namespace/nested.carbon b/toolchain/lower/testdata/namespace/nested.carbon index 5da934315b16..d804bab46087 100644 --- a/toolchain/lower/testdata/namespace/nested.carbon +++ b/toolchain/lower/testdata/namespace/nested.carbon @@ -21,14 +21,14 @@ fn Foo.Bar.Baz() { // CHECK:STDOUT: ; ModuleID = 'nested.carbon' // CHECK:STDOUT: source_filename = "nested.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @Wiz() !dbg !4 { +// CHECK:STDOUT: define void @_CWiz.Bar.Foo.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Baz() !dbg !8 { +// CHECK:STDOUT: define void @_CBaz.Bar.Foo.Main() !dbg !8 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @Wiz(), !dbg !9 +// CHECK:STDOUT: call void @_CWiz.Bar.Foo.Main(), !dbg !9 // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -39,10 +39,10 @@ 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", linkageName: "Wiz", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Wiz", linkageName: "_CWiz.Bar.Foo.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Baz", linkageName: "Baz", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Baz", linkageName: "_CBaz.Bar.Foo.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 18, column: 3, scope: !8) // CHECK:STDOUT: !10 = !DILocation(line: 17, column: 1, scope: !8) diff --git a/toolchain/lower/testdata/operators/and.carbon b/toolchain/lower/testdata/operators/and.carbon index 9737e3ef7041..4fdcb44ef7f2 100644 --- a/toolchain/lower/testdata/operators/and.carbon +++ b/toolchain/lower/testdata/operators/and.carbon @@ -18,23 +18,23 @@ fn And() -> bool { // CHECK:STDOUT: ; ModuleID = 'and.carbon' // CHECK:STDOUT: source_filename = "and.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @F() !dbg !4 { +// CHECK:STDOUT: define i1 @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 true, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @G() !dbg !8 { +// CHECK:STDOUT: define i1 @_CG.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 true, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @And() !dbg !10 { +// CHECK:STDOUT: define i1 @_CAnd.Main() !dbg !10 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call i1 @F(), !dbg !11 +// CHECK:STDOUT: %F.call = call i1 @_CF.Main(), !dbg !11 // CHECK:STDOUT: br i1 %F.call, label %and.rhs, label %and.result, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: and.rhs: ; preds = %entry -// CHECK:STDOUT: %G.call = call i1 @G(), !dbg !12 +// CHECK:STDOUT: %G.call = call i1 @_CG.Main(), !dbg !12 // CHECK:STDOUT: br label %and.result, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: and.result: ; preds = %and.rhs, %entry @@ -49,13 +49,13 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 18, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "G", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 18, scope: !8) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "And", linkageName: "And", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "And", linkageName: "_CAnd.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 10, scope: !10) // CHECK:STDOUT: !12 = !DILocation(line: 15, column: 18, scope: !10) // CHECK:STDOUT: !13 = !DILocation(line: 15, column: 3, scope: !10) diff --git a/toolchain/lower/testdata/operators/and_empty_block.carbon b/toolchain/lower/testdata/operators/and_empty_block.carbon index 4b71ab9fd872..71b421999781 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) !dbg !4 { +// CHECK:STDOUT: define i1 @_CAnd.Main(i1 %b, i1 %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br i1 %b, label %and.rhs, label %and.result, !dbg !7 // CHECK:STDOUT: @@ -36,7 +36,7 @@ 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", linkageName: "And", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "And", linkageName: "_CAnd.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 10, scope: !4) diff --git a/toolchain/lower/testdata/operators/assignment.carbon b/toolchain/lower/testdata/operators/assignment.carbon index 29a5e9afe9e2..3d1ecf486977 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() !dbg !4 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca i32, align 4, !dbg !7 // CHECK:STDOUT: store i32 12, ptr %a.var, align 4, !dbg !8 @@ -44,7 +44,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: "assignment.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/operators/not.carbon b/toolchain/lower/testdata/operators/not.carbon index b9d494fd38d4..5eee885f9133 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) !dbg !4 { +// CHECK:STDOUT: define i1 @_CNot.Main(i1 %b) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12 = xor i1 %b, true, !dbg !7 // CHECK:STDOUT: ret i1 %.loc12, !dbg !8 @@ -28,7 +28,7 @@ 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", linkageName: "Not", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Not", linkageName: "_CNot.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 10, scope: !4) diff --git a/toolchain/lower/testdata/operators/or.carbon b/toolchain/lower/testdata/operators/or.carbon index cb4c7bd8674e..f3ff4786adef 100644 --- a/toolchain/lower/testdata/operators/or.carbon +++ b/toolchain/lower/testdata/operators/or.carbon @@ -18,24 +18,24 @@ fn Or() -> bool { // CHECK:STDOUT: ; ModuleID = 'or.carbon' // CHECK:STDOUT: source_filename = "or.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @F() !dbg !4 { +// CHECK:STDOUT: define i1 @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 true, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @G() !dbg !8 { +// CHECK:STDOUT: define i1 @_CG.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i1 true, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i1 @Or() !dbg !10 { +// CHECK:STDOUT: define i1 @_COr.Main() !dbg !10 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %F.call = call i1 @F(), !dbg !11 +// CHECK:STDOUT: %F.call = call i1 @_CF.Main(), !dbg !11 // CHECK:STDOUT: %.loc15_14.3 = xor i1 %F.call, true, !dbg !11 // CHECK:STDOUT: br i1 %.loc15_14.3, label %or.rhs, label %or.result, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: or.rhs: ; preds = %entry -// CHECK:STDOUT: %G.call = call i1 @G(), !dbg !12 +// CHECK:STDOUT: %G.call = call i1 @_CG.Main(), !dbg !12 // CHECK:STDOUT: br label %or.result, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: or.result: ; preds = %or.rhs, %entry @@ -50,13 +50,13 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 18, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "G", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 12, column: 18, scope: !8) -// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Or", linkageName: "Or", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = distinct !DISubprogram(name: "Or", linkageName: "_COr.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !11 = !DILocation(line: 15, column: 10, scope: !10) // CHECK:STDOUT: !12 = !DILocation(line: 15, column: 17, scope: !10) // CHECK:STDOUT: !13 = !DILocation(line: 15, column: 3, scope: !10) diff --git a/toolchain/lower/testdata/operators/or_empty_block.carbon b/toolchain/lower/testdata/operators/or_empty_block.carbon index f56020b91c65..94988174f445 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) !dbg !4 { +// CHECK:STDOUT: define i1 @_COr.Main(i1 %b, i1 %c) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc14_12.1 = xor i1 %b, true, !dbg !7 // CHECK:STDOUT: br i1 %.loc14_12.1, label %or.rhs, label %or.result, !dbg !7 @@ -37,7 +37,7 @@ 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", linkageName: "Or", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Or", linkageName: "_COr.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 10, scope: !4) diff --git a/toolchain/lower/testdata/operators/overloaded.carbon b/toolchain/lower/testdata/operators/overloaded.carbon index 9f31913a829e..972aafd7f781 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) !dbg !4 { +// CHECK:STDOUT: define void @"_COp.Number.Main:Negate.Core.Main"(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, !dbg !7 // CHECK:STDOUT: %.loc17_36.2 = load i1, ptr %.loc17_36.1.is_positive, align 1, !dbg !7 @@ -41,7 +41,7 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: ret void, !dbg !10 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Op.1(ptr sret({ i1 }) %return, ptr %self, ptr %other) !dbg !11 { +// CHECK:STDOUT: define void @"_COp.Number.Main:Mul.Core.Main"(ptr sret({ i1 }) %return, ptr %self, ptr %other) !dbg !11 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc22_33.1.is_positive = getelementptr inbounds nuw { i1 }, ptr %self, i32 0, i32 0, !dbg !12 // CHECK:STDOUT: %.loc22_33.2 = load i1, ptr %.loc22_33.1.is_positive, align 1, !dbg !12 @@ -80,11 +80,11 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: ret void, !dbg !20 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Calculate(ptr sret({ i1 }) %return, ptr %a, ptr %b) !dbg !21 { +// CHECK:STDOUT: define void @_CCalculate.Main(ptr sret({ i1 }) %return, ptr %a, ptr %b) !dbg !21 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc28_10.3.temp = alloca { i1 }, align 8, !dbg !22 -// CHECK:STDOUT: call void @Op(ptr %.loc28_10.3.temp, ptr %a), !dbg !22 -// CHECK:STDOUT: call void @Op.1(ptr %return, ptr %.loc28_10.3.temp, ptr %b), !dbg !22 +// CHECK:STDOUT: call void @"_COp.Number.Main:Negate.Core.Main"(ptr %.loc28_10.3.temp, ptr %a), !dbg !22 +// CHECK:STDOUT: call void @"_COp.Number.Main:Mul.Core.Main"(ptr %return, ptr %.loc28_10.3.temp, ptr %b), !dbg !22 // CHECK:STDOUT: ret void, !dbg !23 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -98,14 +98,14 @@ 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", linkageName: "Op", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Number.Main:Negate.Core.Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 17, column: 32, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 17, column: 28, scope: !4) // CHECK:STDOUT: !9 = !DILocation(line: 17, column: 12, scope: !4) // CHECK:STDOUT: !10 = !DILocation(line: 17, column: 5, scope: !4) -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "Op.1", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Number.Main:Mul.Core.Main", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !12 = !DILocation(line: 22, column: 29, scope: !11) // CHECK:STDOUT: !13 = !DILocation(line: 22, column: 50, scope: !11) // CHECK:STDOUT: !14 = !DILocation(line: 22, column: 28, scope: !11) @@ -115,6 +115,6 @@ fn Calculate(a: Number, b: Number) -> Number { // CHECK:STDOUT: !18 = !DILocation(line: 23, column: 55, scope: !11) // CHECK:STDOUT: !19 = !DILocation(line: 22, column: 12, scope: !11) // CHECK:STDOUT: !20 = !DILocation(line: 22, column: 5, scope: !11) -// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Calculate", linkageName: "Calculate", scope: null, file: !3, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !21 = distinct !DISubprogram(name: "Calculate", linkageName: "_CCalculate.Main", scope: null, file: !3, line: 27, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !22 = !DILocation(line: 28, column: 10, scope: !21) // CHECK:STDOUT: !23 = !DILocation(line: 28, column: 3, scope: !21) diff --git a/toolchain/lower/testdata/packages/cross_package_call.carbon b/toolchain/lower/testdata/packages/cross_package_call.carbon index 26141efa34f4..c24f020f2400 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() !dbg !4 { +// CHECK:STDOUT: define void @_CF.A() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } @@ -35,20 +35,20 @@ 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", linkageName: "F", scope: null, file: !3, line: 4, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.A", scope: null, file: !3, line: 4, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 4, column: 1, scope: !4) // CHECK:STDOUT: ; ModuleID = 'b.carbon' // CHECK:STDOUT: source_filename = "b.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() !dbg !4 { +// CHECK:STDOUT: define void @_CG.Main() !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @F(), !dbg !7 +// CHECK:STDOUT: call void @_CF.A.Main(), !dbg !7 // CHECK:STDOUT: ret void, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: declare void @F() +// CHECK:STDOUT: declare void @_CF.A.Main() // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1} // CHECK:STDOUT: !llvm.dbg.cu = !{!2} @@ -57,7 +57,7 @@ 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", linkageName: "G", scope: null, file: !3, line: 4, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 4, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 4, column: 10, scope: !4) diff --git a/toolchain/lower/testdata/pointer/address_of_field.carbon b/toolchain/lower/testdata/pointer/address_of_field.carbon index df3c583a3805..56b7fa5e0161 100644 --- a/toolchain/lower/testdata/pointer/address_of_field.carbon +++ b/toolchain/lower/testdata/pointer/address_of_field.carbon @@ -20,16 +20,16 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: @struct.loc14_47 = internal constant { i32, i32 } { i32 1, i32 2 } // CHECK:STDOUT: -// CHECK:STDOUT: declare void @G(ptr) +// CHECK:STDOUT: declare void @_CG.Main(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %s.var = alloca { i32, i32 }, align 8, !dbg !7 // CHECK:STDOUT: %.loc14_46.2.a = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 0, !dbg !8 // CHECK:STDOUT: %.loc14_46.4.b = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 1, !dbg !8 // CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %s.var, ptr align 4 @struct.loc14_47, i64 8, i1 false), !dbg !9 // CHECK:STDOUT: %.loc15_7.b = getelementptr inbounds nuw { i32, i32 }, ptr %s.var, i32 0, i32 1, !dbg !10 -// CHECK:STDOUT: call void @G(ptr %.loc15_7.b), !dbg !11 +// CHECK:STDOUT: call void @_CG.Main(ptr %.loc15_7.b), !dbg !11 // CHECK:STDOUT: ret void, !dbg !12 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -45,7 +45,7 @@ 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", linkageName: "F", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/pointer/address_of_unused.carbon b/toolchain/lower/testdata/pointer/address_of_unused.carbon index a1e32f5ec158..0b0f94d4fee0 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() !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !7 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !8 @@ -30,7 +30,7 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/pointer/basic.carbon b/toolchain/lower/testdata/pointer/basic.carbon index 78dc095d67bf..3b3aade1fd60 100644 --- a/toolchain/lower/testdata/pointer/basic.carbon +++ b/toolchain/lower/testdata/pointer/basic.carbon @@ -20,17 +20,17 @@ fn F() -> i32 { // CHECK:STDOUT: ; ModuleID = 'basic.carbon' // CHECK:STDOUT: source_filename = "basic.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @G(ptr %p) !dbg !4 { +// CHECK:STDOUT: define i32 @_CG.Main(ptr %p) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %.loc12_10.2 = load i32, ptr %p, align 4, !dbg !7 // CHECK:STDOUT: ret i32 %.loc12_10.2, !dbg !8 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define i32 @F() !dbg !9 { +// CHECK:STDOUT: define i32 @_CF.Main() !dbg !9 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !10 // CHECK:STDOUT: store i32 0, ptr %n.var, align 4, !dbg !11 -// CHECK:STDOUT: %G.call = call i32 @G(ptr %n.var), !dbg !12 +// CHECK:STDOUT: %G.call = call i32 @_CG.Main(ptr %n.var), !dbg !12 // CHECK:STDOUT: ret i32 %G.call, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -41,12 +41,12 @@ 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", linkageName: "G", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 10, scope: !4) // CHECK:STDOUT: !8 = !DILocation(line: 12, column: 3, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "F", linkageName: "F", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !10 = !DILocation(line: 16, column: 7, scope: !9) // CHECK:STDOUT: !11 = !DILocation(line: 16, column: 3, scope: !9) // CHECK:STDOUT: !12 = !DILocation(line: 17, column: 10, scope: !9) diff --git a/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon b/toolchain/lower/testdata/pointer/pointer_to_pointer.carbon index 142ae5745cde..e68f2c18f7c7 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) !dbg !4 { +// CHECK:STDOUT: define i32 @_CF.Main(ptr %p) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !7 // CHECK:STDOUT: store ptr %p, ptr %a.var, align 8, !dbg !8 @@ -40,7 +40,7 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/return/code_after_return.carbon b/toolchain/lower/testdata/return/code_after_return.carbon index 40a3ce18b2a7..1df8d4b8d464 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() !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: define void @Main() !dbg !8 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !8 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } @@ -35,9 +35,9 @@ 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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !9 = !DILocation(line: 14, column: 3, scope: !8) diff --git a/toolchain/lower/testdata/return/no_value.carbon b/toolchain/lower/testdata/return/no_value.carbon index a4e43cf18441..7c9572b421cb 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() !dbg !4 { +// CHECK:STDOUT: define void @_CMain.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret void, !dbg !7 // CHECK:STDOUT: } @@ -27,7 +27,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: "no_value.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/return/return_var.carbon b/toolchain/lower/testdata/return/return_var.carbon index eb0ec185576e..3063aa012c0f 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) !dbg !4 { +// CHECK:STDOUT: define void @_CMake.Main(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, !dbg !7 // CHECK:STDOUT: %.loc18_30.4.next = getelementptr inbounds nuw { i32, ptr }, ptr %return, i32 0, i32 1, !dbg !7 @@ -37,7 +37,7 @@ 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", linkageName: "Make", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Make", linkageName: "_CMake.Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 18, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/return/return_var_byval.carbon b/toolchain/lower/testdata/return/return_var_byval.carbon index 8a51a51c0d01..55c420829238 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() !dbg !4 { +// CHECK:STDOUT: define i32 @_CMain.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca i32, align 4, !dbg !7 // CHECK:STDOUT: store i32 0, ptr %x.var, align 4, !dbg !8 @@ -31,7 +31,7 @@ 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", linkageName: "Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 16, scope: !4) diff --git a/toolchain/lower/testdata/return/value.carbon b/toolchain/lower/testdata/return/value.carbon index 9acf6aab27e8..0a772d6970f5 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() !dbg !4 { +// CHECK:STDOUT: define i32 @_CMain.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: ret i32 0, !dbg !7 // CHECK:STDOUT: } @@ -27,7 +27,7 @@ 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", linkageName: "Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/return/var.carbon b/toolchain/lower/testdata/return/var.carbon index ff723860a62a..271544d634ef 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() !dbg !4 { +// CHECK:STDOUT: define i32 @_CMain.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %x.var = alloca i32, align 4, !dbg !7 // CHECK:STDOUT: store i32 0, ptr %x.var, align 4, !dbg !8 @@ -31,7 +31,7 @@ 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", linkageName: "Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Main", linkageName: "_CMain.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 12, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon index 71ce1ebbdf46..b110ded86f14 100644 --- a/toolchain/lower/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/lower/testdata/struct/nested_struct_in_place.carbon @@ -17,15 +17,15 @@ fn G() { // CHECK:STDOUT: ; ModuleID = 'nested_struct_in_place.carbon' // CHECK:STDOUT: source_filename = "nested_struct_in_place.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: declare void @F(ptr sret({ i32, i32, i32 })) +// CHECK:STDOUT: declare void @_CF.Main(ptr sret({ i32, i32, i32 })) // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() !dbg !4 { +// CHECK:STDOUT: define void @_CG.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca { { i32, i32, i32 }, { i32, i32, i32 } }, align 8, !dbg !7 // CHECK:STDOUT: %.loc14_74.1.a = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: call void @F(ptr %.loc14_74.1.a), !dbg !9 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_74.1.a), !dbg !9 // CHECK:STDOUT: %.loc14_74.2.b = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 1, !dbg !8 -// CHECK:STDOUT: call void @F(ptr %.loc14_74.2.b), !dbg !10 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_74.2.b), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -36,7 +36,7 @@ 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", linkageName: "G", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/tuple/access/return_value_access.carbon b/toolchain/lower/testdata/tuple/access/return_value_access.carbon index 112baa51e642..8bada903f65b 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) !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main(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, !dbg !7 // CHECK:STDOUT: %.loc11_38.4.tuple.elem = getelementptr inbounds nuw { i32, i32 }, ptr %return, i32 0, i32 1, !dbg !7 @@ -31,7 +31,7 @@ fn Run() { // CHECK:STDOUT: entry: // CHECK:STDOUT: %t.var = alloca i32, align 4, !dbg !10 // CHECK:STDOUT: %.loc14_17.1.temp = alloca { i32, i32 }, align 8, !dbg !11 -// CHECK:STDOUT: call void @F(ptr %.loc14_17.1.temp), !dbg !11 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_17.1.temp), !dbg !11 // CHECK:STDOUT: %.loc14_19.1.tuple.index = getelementptr inbounds nuw { i32, i32 }, ptr %.loc14_17.1.temp, i32 0, i32 1, !dbg !11 // CHECK:STDOUT: %.loc14_19.2 = load i32, ptr %.loc14_19.1.tuple.index, align 4, !dbg !11 // CHECK:STDOUT: store i32 %.loc14_19.2, ptr %t.var, align 4, !dbg !12 @@ -50,7 +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", linkageName: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 11, column: 31, scope: !4) diff --git a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon index 2384cb65bfcf..f832080472fc 100644 --- a/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon +++ b/toolchain/lower/testdata/tuple/nested_tuple_in_place.carbon @@ -17,15 +17,15 @@ fn G() { // CHECK:STDOUT: ; ModuleID = 'nested_tuple_in_place.carbon' // CHECK:STDOUT: source_filename = "nested_tuple_in_place.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: declare void @F(ptr sret({ i32, i32, i32 })) +// CHECK:STDOUT: declare void @_CF.Main(ptr sret({ i32, i32, i32 })) // CHECK:STDOUT: -// CHECK:STDOUT: define void @G() !dbg !4 { +// CHECK:STDOUT: define void @_CG.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %v.var = alloca { { i32, i32, i32 }, { i32, i32, i32 } }, align 8, !dbg !7 // CHECK:STDOUT: %.loc14_56.1.tuple.elem = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 0, !dbg !8 -// CHECK:STDOUT: call void @F(ptr %.loc14_56.1.tuple.elem), !dbg !9 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_56.1.tuple.elem), !dbg !9 // CHECK:STDOUT: %.loc14_56.2.tuple.elem = getelementptr inbounds nuw { { i32, i32, i32 }, { i32, i32, i32 } }, ptr %v.var, i32 0, i32 1, !dbg !8 -// CHECK:STDOUT: call void @F(ptr %.loc14_56.2.tuple.elem), !dbg !10 +// CHECK:STDOUT: call void @_CF.Main(ptr %.loc14_56.2.tuple.elem), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -36,7 +36,7 @@ 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", linkageName: "G", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/tuple/value_formation.carbon b/toolchain/lower/testdata/tuple/value_formation.carbon index d99f713376b0..228a6f108229 100644 --- a/toolchain/lower/testdata/tuple/value_formation.carbon +++ b/toolchain/lower/testdata/tuple/value_formation.carbon @@ -19,9 +19,9 @@ fn F() { // CHECK:STDOUT: ; ModuleID = 'value_formation.carbon' // CHECK:STDOUT: source_filename = "value_formation.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: declare void @G(ptr) +// CHECK:STDOUT: declare void @_CG.Main(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: define void @F() !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca { i32, i32, i32 }, align 8, !dbg !7 // CHECK:STDOUT: %b.var = alloca { i32, i32, i32 }, align 8, !dbg !8 @@ -56,7 +56,7 @@ fn F() { // CHECK:STDOUT: store ptr %tuple.loc16_6, ptr %tuple.loc16_107, align 8, !dbg !11 // CHECK:STDOUT: %tuple.loc16_108 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple.loc16_10, i32 0, i32 1, !dbg !11 // CHECK:STDOUT: store ptr %tuple.loc16_9, ptr %tuple.loc16_108, align 8, !dbg !11 -// CHECK:STDOUT: call void @G(ptr %tuple.loc16_10), !dbg !12 +// CHECK:STDOUT: call void @_CG.Main(ptr %tuple.loc16_10), !dbg !12 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -67,7 +67,7 @@ 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", linkageName: "F", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 7, scope: !4) diff --git a/toolchain/lower/testdata/tuple/value_forwarding.carbon b/toolchain/lower/testdata/tuple/value_forwarding.carbon index 059fcaee7fd9..3eec759e1aa5 100644 --- a/toolchain/lower/testdata/tuple/value_forwarding.carbon +++ b/toolchain/lower/testdata/tuple/value_forwarding.carbon @@ -17,16 +17,16 @@ fn F(a: (i32, i32, i32), b: (i32, i32, i32)) { // CHECK:STDOUT: ; ModuleID = 'value_forwarding.carbon' // CHECK:STDOUT: source_filename = "value_forwarding.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: declare void @G(ptr) +// CHECK:STDOUT: declare void @_CG.Main(ptr) // CHECK:STDOUT: -// CHECK:STDOUT: define void @F(ptr %a, ptr %b) !dbg !4 { +// CHECK:STDOUT: define void @_CF.Main(ptr %a, ptr %b) !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %tuple = alloca { ptr, ptr }, align 8, !dbg !7 // CHECK:STDOUT: %tuple1 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple, i32 0, i32 0, !dbg !7 // CHECK:STDOUT: store ptr %a, ptr %tuple1, align 8, !dbg !7 // CHECK:STDOUT: %tuple2 = getelementptr inbounds nuw { ptr, ptr }, ptr %tuple, i32 0, i32 1, !dbg !7 // CHECK:STDOUT: store ptr %b, ptr %tuple2, align 8, !dbg !7 -// CHECK:STDOUT: call void @G(ptr %tuple), !dbg !8 +// CHECK:STDOUT: call void @_CG.Main(ptr %tuple), !dbg !8 // CHECK:STDOUT: ret void, !dbg !9 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -37,7 +37,7 @@ 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", linkageName: "F", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 14, column: 5, scope: !4) diff --git a/toolchain/lower/testdata/while/break_continue.carbon b/toolchain/lower/testdata/while/break_continue.carbon index 2d7cb52accc0..99f76bb98644 100644 --- a/toolchain/lower/testdata/while/break_continue.carbon +++ b/toolchain/lower/testdata/while/break_continue.carbon @@ -22,29 +22,29 @@ fn While() { // CHECK:STDOUT: ; ModuleID = 'break_continue.carbon' // CHECK:STDOUT: source_filename = "break_continue.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: declare i1 @A() +// CHECK:STDOUT: declare i1 @_CA.Main() // CHECK:STDOUT: -// CHECK:STDOUT: declare i1 @B() +// CHECK:STDOUT: declare i1 @_CB.Main() // CHECK:STDOUT: -// CHECK:STDOUT: declare i1 @C() +// CHECK:STDOUT: declare i1 @_CC.Main() // CHECK:STDOUT: -// CHECK:STDOUT: define void @While() !dbg !4 { +// CHECK:STDOUT: define void @_CWhile.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br label %while.cond // CHECK:STDOUT: // CHECK:STDOUT: while.cond: ; preds = %entry, %if.else.loc18, %if.then.loc17 -// CHECK:STDOUT: %A.call = call i1 @A(), !dbg !7 +// CHECK:STDOUT: %A.call = call i1 @_CA.Main(), !dbg !7 // CHECK:STDOUT: br i1 %A.call, label %while.body, label %while.done, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: while.body: ; preds = %while.cond -// CHECK:STDOUT: %B.call = call i1 @B(), !dbg !9 +// CHECK:STDOUT: %B.call = call i1 @_CB.Main(), !dbg !9 // CHECK:STDOUT: br i1 %B.call, label %if.then.loc17, label %if.else.loc17, !dbg !10 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc17: ; preds = %while.body // CHECK:STDOUT: br label %while.cond, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: if.else.loc17: ; preds = %while.body -// CHECK:STDOUT: %C.call = call i1 @C(), !dbg !12 +// CHECK:STDOUT: %C.call = call i1 @_CC.Main(), !dbg !12 // CHECK:STDOUT: br i1 %C.call, label %if.then.loc18, label %if.else.loc18, !dbg !13 // CHECK:STDOUT: // CHECK:STDOUT: if.then.loc18: ; preds = %if.else.loc17 @@ -67,7 +67,7 @@ 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", linkageName: "While", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "While", linkageName: "_CWhile.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 16, column: 10, scope: !4) diff --git a/toolchain/lower/testdata/while/preheader.carbon b/toolchain/lower/testdata/while/preheader.carbon index ba9d51a05fe9..b0ebec653b4a 100644 --- a/toolchain/lower/testdata/while/preheader.carbon +++ b/toolchain/lower/testdata/while/preheader.carbon @@ -31,34 +31,34 @@ fn While() { // CHECK:STDOUT: ; ModuleID = 'preheader.carbon' // CHECK:STDOUT: source_filename = "preheader.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: declare i1 @Cond() +// CHECK:STDOUT: declare i1 @_CCond.Main() // CHECK:STDOUT: -// CHECK:STDOUT: declare void @F() +// CHECK:STDOUT: declare void @_CF.Main() // CHECK:STDOUT: -// CHECK:STDOUT: declare void @G() +// CHECK:STDOUT: declare void @_CG.Main() // CHECK:STDOUT: -// CHECK:STDOUT: define void @While() !dbg !4 { +// CHECK:STDOUT: define void @_CWhile.Main() !dbg !4 { // CHECK:STDOUT: entry: // CHECK:STDOUT: br label %while.cond.loc20 // CHECK:STDOUT: // CHECK:STDOUT: while.cond.loc20: ; preds = %entry, %while.body.loc20 -// CHECK:STDOUT: %Cond.call.loc20 = call i1 @Cond(), !dbg !7 +// CHECK:STDOUT: %Cond.call.loc20 = call i1 @_CCond.Main(), !dbg !7 // CHECK:STDOUT: br i1 %Cond.call.loc20, label %while.body.loc20, label %while.done.loc20, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: while.body.loc20: ; preds = %while.cond.loc20 -// CHECK:STDOUT: call void @F(), !dbg !9 +// CHECK:STDOUT: call void @_CF.Main(), !dbg !9 // CHECK:STDOUT: br label %while.cond.loc20, !dbg !10 // CHECK:STDOUT: // CHECK:STDOUT: while.done.loc20: ; preds = %while.cond.loc20 -// CHECK:STDOUT: %Cond.call.loc24 = call i1 @Cond(), !dbg !11 +// CHECK:STDOUT: %Cond.call.loc24 = call i1 @_CCond.Main(), !dbg !11 // CHECK:STDOUT: br i1 %Cond.call.loc24, label %while.cond.loc25, label %if.else, !dbg !12 // CHECK:STDOUT: // CHECK:STDOUT: while.cond.loc25: ; preds = %while.body.loc25, %while.done.loc20 -// CHECK:STDOUT: %Cond.call.loc25 = call i1 @Cond(), !dbg !13 +// CHECK:STDOUT: %Cond.call.loc25 = call i1 @_CCond.Main(), !dbg !13 // CHECK:STDOUT: br i1 %Cond.call.loc25, label %while.body.loc25, label %while.done.loc25, !dbg !14 // CHECK:STDOUT: // CHECK:STDOUT: while.body.loc25: ; preds = %while.cond.loc25 -// CHECK:STDOUT: call void @G(), !dbg !15 +// CHECK:STDOUT: call void @_CG.Main(), !dbg !15 // CHECK:STDOUT: br label %while.cond.loc25, !dbg !16 // CHECK:STDOUT: // CHECK:STDOUT: while.done.loc25: ; preds = %while.cond.loc25 @@ -78,7 +78,7 @@ 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", linkageName: "While", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "While", linkageName: "_CWhile.Main", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 20, column: 10, scope: !4) diff --git a/toolchain/lower/testdata/while/unreachable_end.carbon b/toolchain/lower/testdata/while/unreachable_end.carbon index 8a50e4bb4e78..abd175daba7e 100644 --- a/toolchain/lower/testdata/while/unreachable_end.carbon +++ b/toolchain/lower/testdata/while/unreachable_end.carbon @@ -26,29 +26,29 @@ fn While() { // CHECK:STDOUT: ; ModuleID = 'unreachable_end.carbon' // CHECK:STDOUT: source_filename = "unreachable_end.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: declare i1 @Cond() +// CHECK:STDOUT: declare i1 @_CCond.Main() // CHECK:STDOUT: -// CHECK:STDOUT: declare void @F() +// CHECK:STDOUT: declare void @_CF.Main() // CHECK:STDOUT: -// CHECK:STDOUT: declare void @G() +// CHECK:STDOUT: declare void @_CG.Main() // CHECK:STDOUT: -// CHECK:STDOUT: declare void @H() +// CHECK:STDOUT: declare void @_CH.Main() // CHECK:STDOUT: -// CHECK:STDOUT: define void @While() !dbg !4 { +// CHECK:STDOUT: define void @_CWhile.Main() !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @F(), !dbg !7 +// CHECK:STDOUT: call void @_CF.Main(), !dbg !7 // CHECK:STDOUT: br label %while.cond, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: while.cond: ; preds = %entry -// CHECK:STDOUT: %Cond.call = call i1 @Cond(), !dbg !9 +// CHECK:STDOUT: %Cond.call = call i1 @_CCond.Main(), !dbg !9 // CHECK:STDOUT: br i1 %Cond.call, label %while.body, label %while.done, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: while.body: ; preds = %while.cond -// CHECK:STDOUT: call void @G(), !dbg !10 +// CHECK:STDOUT: call void @_CG.Main(), !dbg !10 // CHECK:STDOUT: ret void, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %while.cond -// CHECK:STDOUT: call void @H(), !dbg !12 +// CHECK:STDOUT: call void @_CH.Main(), !dbg !12 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -59,7 +59,7 @@ 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", linkageName: "While", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "While", linkageName: "_CWhile.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 18, column: 3, scope: !4) diff --git a/toolchain/lower/testdata/while/while.carbon b/toolchain/lower/testdata/while/while.carbon index 8708aacd45b4..c00fe82f5d26 100644 --- a/toolchain/lower/testdata/while/while.carbon +++ b/toolchain/lower/testdata/while/while.carbon @@ -25,29 +25,29 @@ fn While() { // CHECK:STDOUT: ; ModuleID = 'while.carbon' // CHECK:STDOUT: source_filename = "while.carbon" // CHECK:STDOUT: -// CHECK:STDOUT: declare i1 @Cond() +// CHECK:STDOUT: declare i1 @_CCond.Main() // CHECK:STDOUT: -// CHECK:STDOUT: declare void @F() +// CHECK:STDOUT: declare void @_CF.Main() // CHECK:STDOUT: -// CHECK:STDOUT: declare void @G() +// CHECK:STDOUT: declare void @_CG.Main() // CHECK:STDOUT: -// CHECK:STDOUT: declare void @H() +// CHECK:STDOUT: declare void @_CH.Main() // CHECK:STDOUT: -// CHECK:STDOUT: define void @While() !dbg !4 { +// CHECK:STDOUT: define void @_CWhile.Main() !dbg !4 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: call void @F(), !dbg !7 +// CHECK:STDOUT: call void @_CF.Main(), !dbg !7 // CHECK:STDOUT: br label %while.cond, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: while.cond: ; preds = %while.body, %entry -// CHECK:STDOUT: %Cond.call = call i1 @Cond(), !dbg !9 +// CHECK:STDOUT: %Cond.call = call i1 @_CCond.Main(), !dbg !9 // CHECK:STDOUT: br i1 %Cond.call, label %while.body, label %while.done, !dbg !8 // CHECK:STDOUT: // CHECK:STDOUT: while.body: ; preds = %while.cond -// CHECK:STDOUT: call void @G(), !dbg !10 +// CHECK:STDOUT: call void @_CG.Main(), !dbg !10 // CHECK:STDOUT: br label %while.cond, !dbg !11 // CHECK:STDOUT: // CHECK:STDOUT: while.done: ; preds = %while.cond -// CHECK:STDOUT: call void @H(), !dbg !12 +// CHECK:STDOUT: call void @_CH.Main(), !dbg !12 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -58,7 +58,7 @@ 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", linkageName: "While", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "While", linkageName: "_CWhile.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} // CHECK:STDOUT: !7 = !DILocation(line: 18, column: 3, scope: !4)