Home | History | Annotate | Download | only in Generic
      1 ; RUN: opt -analyze -module-debuginfo < %s | FileCheck %s
      2 
      3 ; This is to track DebugInfoFinder's ability to find the debug info metadata,
      4 ; in particular, properly visit different kinds of DIImportedEntit'ies.
      5 
      6 ; Derived from the following C++ snippet
      7 ;
      8 ; namespace s {
      9 ;   int i;
     10 ; }
     11 ;
     12 ; using s::i;
     13 ;
     14 ; compiled with `clang -O1 -g3 -emit-llvm -S`
     15 
     16 ; CHECK: Printing analysis 'Decodes module-level debug info':
     17 ; CHECK: Compile unit: DW_LANG_C_plus_plus from /somewhere/source.cpp
     18 ; CHECK: Global variable: i from /somewhere/source.cpp:2 ('_ZN1s1iE')
     19 ; CHECK: Type: int DW_ATE_signed
     20 
     21 @_ZN1s1iE = local_unnamed_addr global i32 0, align 4, !dbg !0
     22 
     23 !llvm.dbg.cu = !{!5}
     24 !llvm.module.flags = !{!10, !11, !12, !13}
     25 !llvm.ident = !{!14}
     26 
     27 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
     28 !1 = distinct !DIGlobalVariable(name: "i", linkageName: "_ZN1s1iE", scope: !2, file: !3, line: 2, type: !4, isLocal: false, isDefinition: true)
     29 !2 = !DINamespace(name: "s", scope: null)
     30 !3 = !DIFile(filename: "source.cpp", directory: "/somewhere")
     31 !4 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
     32 !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 7.0.99 (https://git.llvm.org/git/clang.git/ ec45e6c6530b8f9a1046d0a7efae467b3151783b) (https://git.llvm.org/git/llvm.git/ 9d2fcc2bf4a301d05d9b440a805847645637ab28)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !6, globals: !7, imports: !8)
     33 !6 = !{}
     34 !7 = !{!0}
     35 !8 = !{!9}
     36 !9 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !1, file: !3, line: 5)
     37 !10 = !{i32 2, !"Dwarf Version", i32 4}
     38 !11 = !{i32 2, !"Debug Info Version", i32 3}
     39 !12 = !{i32 1, !"wchar_size", i32 4}
     40 !13 = !{i32 7, !"PIC Level", i32 2}
     41 !14 = !{!"clang version 7.0.99 (https://git.llvm.org/git/clang.git/ ec45e6c6530b8f9a1046d0a7efae467b3151783b) (https://git.llvm.org/git/llvm.git/ 9d2fcc2bf4a301d05d9b440a805847645637ab28)"}
     42