1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/test/DebugInfo/X86/DIModuleContext.ll
Adrian Prantl 3363ed7b0a Move the sysroot attribute from DIModule to DICompileUnit
[this re-applies c0176916a4824812d25a5a22c4ff7c95857b0cd6
 with the correct commit message and phabricator link]

This addresses point 1 of PR44213.
https://bugs.llvm.org/show_bug.cgi?id=44213

The DW_AT_LLVM_sysroot attribute is used for Clang module debug info,
to allow LLDB to import a Clang module from source. Currently it is
part of each DW_TAG_module, however, it is the same for all modules in
a compile unit. It is more efficient and less ambiguous to store it
once in the DW_TAG_compile_unit.

This should have no effect on DWARF consumers other than LLDB.

Differential Revision: https://reviews.llvm.org/D71732
2020-01-17 12:55:40 -08:00

34 lines
1.3 KiB
LLVM

source_filename = "test/DebugInfo/X86/DIModuleContext.ll"
target triple = "x86_64-apple-macosx"
; RUN: %llc_dwarf %s -o - -filetype=obj \
; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s
; CHECK: DW_TAG_module
; CHECK-NOT: NULL
; CHECK: DW_TAG_structure_type
; Hand-crafted based on
; struct s;
; struct s *s;
%struct.s = type opaque
@i = common global %struct.s* null, align 8, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!11, !12}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = !DIGlobalVariable(name: "s", scope: !2, file: !3, line: 2, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, imports: !6)
!3 = !DIFile(filename: "test.c", directory: "/")
!4 = !{}
!5 = !{!0}
!6 = !{!7}
!7 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !2, entity: !8, file: !3, line: 11)
!8 = !DIModule(scope: null, name: "Module", includePath: ".")
!9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64)
!10 = !DICompositeType(tag: DW_TAG_structure_type, name: "s", scope: !8, file: !3, line: 1, flags: DIFlagFwdDecl)
!11 = !{i32 2, !"Dwarf Version", i32 2}
!12 = !{i32 2, !"Debug Info Version", i32 3}