2018-04-17 07:39:44 +08:00
; RUN: opt -analyze -module-debuginfo < %s | FileCheck %s
; This is to track DebugInfoFinder's ability to find the debug info metadata,
; in particular, properly visit different kinds of DIImportedEntit'ies.
; Derived from the following C++ snippet
;
; namespace s {
; int i;
; }
;
; using s::i;
;
; compiled with `clang -O1 -g3 -emit-llvm -S`
; CHECK: Printing analysis 'Decodes module-level debug info':
; CHECK: Compile unit: DW_LANG_C_plus_plus from /somewhere/source.cpp
; CHECK: Global variable: i from /somewhere/source.cpp:2 ('_ZN1s1iE')
; CHECK: Type: int DW_ATE_signed
@_ZN1s1iE = local_unnamed_addr global i32 0 , align 4 , !dbg !0
!llvm.dbg.cu = ! { !5 }
!llvm.module.flags = ! { !10 , !11 , !12 , !13 }
!llvm.ident = ! { !14 }
!0 = !DIGlobalVariableExpression ( var: !1 , expr: !DIExpression ( ) )
!1 = distinct !DIGlobalVariable ( name: "i" , linkageName: "_ZN1s1iE" , scope: !2 , file: !3 , line: 2 , type: !4 , isLocal: false , isDefinition: true )
!2 = !DINamespace ( name: "s" , scope: null )
!3 = !DIFile ( filename: "source.cpp" , directory: "/somewhere" )
!4 = !DIBasicType ( name: "int" , size: 32 , encoding: D W _ A T E _ s i g n e d )
2019-01-16 00:18:52 +08:00
!5 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , file: !3 , producer: "clang version 7.0.99" , isOptimized: true , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !6 , globals: !7 , imports: !8 )
2018-04-17 07:39:44 +08:00
!6 = ! { }
!7 = ! { !0 }
!8 = ! { !9 }
!9 = !DIImportedEntity ( tag: D W _ T A G _ i m p o r t e d _ d e c l a r a t i o n , scope: !5 , entity: !1 , file: !3 , line: 5 )
!10 = ! { i32 2 , !"Dwarf Version" , i32 4 }
!11 = ! { i32 2 , !"Debug Info Version" , i32 3 }
!12 = ! { i32 1 , !"wchar_size" , i32 4 }
!13 = ! { i32 7 , !"PIC Level" , i32 2 }
2019-01-16 00:18:52 +08:00
!14 = ! { !"clang version 7.0.99" }