79 lines · plain
1; RUN: llc %s -filetype=obj -o - | llvm-dwarfdump -verify -2; RUN: llc %s -filetype=obj -o - | llvm-dwarfdump -debug-info - | FileCheck %s3 4;; This test exercises the cross-CU production of type information. Due to5;; unfortunate inputs, when the DW_TAG_variable for the global6;; @a_struct_field8typeDataE is produced it will be done in the CU for 2.cpp.7;; However, the type information for the "a_struct" structure type will have8;; already been produced in 3.cpp's CU. Thus, we'll be creating a DIE in one9;; CU from another CU. Check that when we do so, we get the source file10;; identifier correct -- if the FileID came from the wrong CU then we'd end11;; up with a false declaration file.12;;13;; Due to unrelated reasons there are two copies of the "typeData" static member14;; in this LTO-linked IR -- if that ever gets fitxed, it's fine to drop the15;; duplicate DW_TAG_variable, but we want to keep testing the DW_AT_decl_file16;; that's created across a CU boundary.17;;18;; https://github.com/llvm/llvm-project/issues/10922719 20; CHECK-LABEL: DW_TAG_structure_type21; CHECK-NOT: DW_TAG22; CHECK: DW_AT_name ("a_struct")23; CHECK-NOT: DW_TAG24; CHECK: DW_TAG_variable25; CHECK-NOT: DW_TAG26; CHECK: DW_AT_decl_file ("C:\Users\gbmorsej\source\bees{{\\|/}}3.cpp")27; CHECK-NOT: DW_TAG28; CHECK: DW_TAG_variable29; CHECK-NOT: DW_TAG30; CHECK: DW_AT_decl_file ("C:\users\gbmorsej\source/bees{{\\|/}}2.cpp")31 32target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"33target triple = "x86_64-sie-ps5"34 35%struct.a_struct = type { i8 }36 37@__trans_tmp_2 = hidden local_unnamed_addr global %struct.a_struct zeroinitializer, align 1, !dbg !038@a_struct_field8typeDataE = hidden local_unnamed_addr global i64 0, align 8, !dbg !1339 40!llvm.dbg.cu = !{!2, !15}41!llvm.linker.options = !{}42!llvm.ident = !{!22, !22}43!llvm.module.flags = !{!23, !24, !25, !26, !27, !28, !29, !30, !31, !32}44 45!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())46!1 = distinct !DIGlobalVariable(name: "__trans_tmp_2", scope: !2, file: !3, line: 9, type: !5, isLocal: false, isDefinition: true)47!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_20, file: !3, producer: "clang version 21.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, debugInfoForProfiling: true, nameTableKind: None)48!3 = !DIFile(filename: "3.cpp", directory: "C:\\Users\\gbmorsej\\source\\bees", checksumkind: CSK_MD5, checksum: "05973c817251e916cc8ba01e728764dc")49!4 = !{!0}50!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "a_struct", file: !3, line: 4, size: 8, flags: DIFlagTypePassByValue, elements: !6, identifier: "redacted_struct_name")51!6 = !{!7}52!7 = !DIDerivedType(tag: DW_TAG_variable, name: "typeData", scope: !5, file: !3, line: 6, baseType: !8, flags: DIFlagStaticMember)53!8 = !DIDerivedType(tag: DW_TAG_typedef, name: "TypeData", scope: !10, file: !9, line: 6, baseType: !12)54!9 = !DIFile(filename: ".\\h1.h", directory: "C:\\Users\\gbmorsej\\source\\bees", checksumkind: CSK_MD5, checksum: "0c90de8c8e867df533d869035e11cf8c")55!10 = !DINamespace(name: "b", scope: !11)56!11 = !DINamespace(name: "a", scope: null)57!12 = !DIBasicType(name: "long", size: 64, encoding: DW_ATE_signed)58!13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression())59!14 = distinct !DIGlobalVariable(name: "typeData", linkageName: "a_struct_field8typeDataE", scope: !15, file: !18, line: 10, type: !19, isLocal: false, isDefinition: true, declaration: !21)60!15 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_20, file: !16, producer: "clang version 21.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, globals: !17, splitDebugInlining: false, debugInfoForProfiling: true, nameTableKind: None)61!16 = !DIFile(filename: "C:\\users\\gbmorsej\\source/bees\\2.cpp", directory: "C:\\Users\\gbmorsej\\source\\bees", checksumkind: CSK_MD5, checksum: "231f25b4978512f0d961a1d7baa9cb01")62!17 = !{!13}63!18 = !DIFile(filename: "C:\\users\\gbmorsej\\source/bees/2.cpp", directory: "", checksumkind: CSK_MD5, checksum: "231f25b4978512f0d961a1d7baa9cb01")64!19 = !DIDerivedType(tag: DW_TAG_typedef, name: "TypeData", scope: !10, file: !20, line: 6, baseType: !12)65!20 = !DIFile(filename: "h1.h", directory: "C:\\Users\\gbmorsej\\source\\bees", checksumkind: CSK_MD5, checksum: "0c90de8c8e867df533d869035e11cf8c")66!21 = !DIDerivedType(tag: DW_TAG_variable, name: "typeData", scope: !5, file: !18, line: 6, baseType: !19, flags: DIFlagStaticMember)67!22 = !{!"clang version 21.0.0"}68!23 = !{i32 7, !"Dwarf Version", i32 5}69!24 = !{i32 2, !"Debug Info Version", i32 3}70!25 = !{i32 1, !"wchar_size", i32 2}71!26 = !{i32 1, !"SIE:somestuff", i32 2}72!27 = !{i32 8, !"PIC Level", i32 2}73!28 = !{i32 7, !"uwtable", i32 2}74!29 = !{i32 7, !"frame-pointer", i32 1}75!30 = !{i32 1, !"MaxTLSAlign", i32 256}76!31 = !{i32 1, !"EnableSplitLTOUnit", i32 1}77!32 = !{i32 1, !"UnifiedLTO", i32 1}78 79