2018-02-07 07:45:59 +08:00
; REQUIRES: object-emission
; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s
; Check for a variant part that has two members, one of which has a
; discriminant value.
; CHECK: DW_TAG_variant_part
; CHECK-NOT: TAG
; CHECK: DW_AT_discr [DW_FORM_ref4] (cu + {{0x[0-9a-fA-F]+}} => {[[OFFSET:0x[0-9a-fA-F]+]]})
; CHECK-NOT: TAG
; CHECK: [[OFFSET]]: DW_TAG_member
; CHECK: DW_AT_type
; CHECK: DW_AT_alignment
; CHECK: DW_AT_data_member_location [DW_FORM_data1] (0x00)
; CHECK: DW_AT_artificial [DW_FORM_flag_present] (true)
; CHECK: DW_TAG_variant
; CHECK: DW_TAG_member
; CHECK: DW_AT_type
; CHECK: DW_AT_alignment
; CHECK: DW_AT_data_member_location [DW_FORM_data1] (0x00)
; CHECK: DW_TAG_variant
; CHECK: DW_AT_discr_value [DW_FORM_data1] (0x00)
; CHECK: DW_TAG_member
; CHECK: DW_AT_type
; CHECK: DW_AT_alignment
; CHECK: DW_AT_data_member_location [DW_FORM_data1] (0x00)
%F = type { [ 0 x i8 ] , { } * , [ 8 x i8 ] }
%"F::Nope" = type { }
define internal void @_ZN2e34main17h934ff72f9a38d4bbE ( ) unnamed_addr #0 !dbg !5 {
start:
%qq = alloca %F , align 8
call void @llvm.dbg.declare ( metadata %F * %qq , metadata !10 , metadata !28 ) , !dbg !29
%0 = bitcast %F * %qq to { } * * , !dbg !29
store { } * null , { } * * %0 , !dbg !29
%1 = bitcast %F * %qq to %"F::Nope" * , !dbg !29
ret void , !dbg !30
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare ( metadata , metadata , metadata ) #0
attributes #0 = { nounwind uwtable }
!llvm.module.flags = ! { !0 , !1 }
!llvm.dbg.cu = ! { !2 }
!0 = ! { i32 1 , !"PIE Level" , i32 2 }
!1 = ! { i32 2 , !"Debug Info Version" , i32 3 }
!2 = distinct !DICompileUnit ( language: D W _ L A N G _ R u s t , file: !3 , producer: "clang LLVM (rustc version 1.24.0-dev)" , isOptimized: false , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !4 )
!3 = !DIFile ( filename: "e3.rs" , directory: "/home/tromey/Rust" )
!4 = ! { }
2019-03-19 21:49:03 +08:00
!5 = distinct !DISubprogram ( name: "main" , linkageName: "_ZN2e34mainE" , scope: !6 , file: !3 , line: 2 , type: !8 , scopeLine: 2 , flags: D I F l a g P r o t o t y p e d , spFlags: D I S P F l a g L o c a l T o U n i t | D I S P F l a g D e f i n i t i o n | D I S P F l a g M a i n S u b p r o g r a m , isOptimized: false , unit: !2 , templateParams: !4 , retainedNodes: !4 )
2018-02-07 07:45:59 +08:00
!6 = !DINamespace ( name: "e3" , scope: null )
!7 = !DIFile ( filename: "<unknown>" , directory: "" )
!8 = !DISubroutineType ( types: !9 )
!9 = ! { null }
!10 = !DILocalVariable ( name: "qq" , scope: !11 , file: !3 , line: 3 , type: !12 , align: 8 )
!11 = distinct !DILexicalBlock ( scope: !5 , file: !3 , line: 3 , column: 4 )
!12 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "F" , scope: !6 , file: !7 , size: 128 , align: 64 , elements: !13 , identifier: "7ce1efff6b82281ab9ceb730566e7e20" )
!13 = ! { !14 }
!14 = !DICompositeType ( tag: D W _ T A G _ v a r i a n t _ p a r t , name: "" , scope: !12 , file: !7 , size: 128 , align: 64 , elements: !16 , identifier: "7ce1efff6b82281ab9ceb730566e7e20" , discriminator: !15 )
!15 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , scope: !14 , file: !7 , baseType: !27 , size: 64 , align: 64 , flags: D I F l a g A r t i f i c i a l )
!16 = ! { !17 , !24 }
!17 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , scope: !14 , file: !7 , baseType: !18 , size: 128 , align: 64 )
!18 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "Yep" , scope: !12 , file: !7 , size: 128 , align: 64 , elements: !19 , identifier: "7ce1efff6b82281ab9ceb730566e7e20::Yep" )
!19 = ! { !20 , !22 }
!20 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "__0" , scope: !18 , file: !7 , baseType: !21 , size: 8 , align: 8 , offset: 64 )
!21 = !DIBasicType ( name: "u8" , size: 8 , encoding: D W _ A T E _ u n s i g n e d )
!22 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "__1" , scope: !18 , file: !7 , baseType: !23 , size: 64 , align: 64 )
!23 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , name: "&u8" , baseType: !21 , size: 64 , align: 64 )
!24 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , scope: !14 , file: !7 , baseType: !25 , size: 128 , align: 64 , extraData: i64 0 )
!25 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "Nope" , scope: !12 , file: !7 , size: 128 , align: 64 , elements: !4 , identifier: "7ce1efff6b82281ab9ceb730566e7e20::Nope" )
!27 = !DIBasicType ( name: "u64" , size: 64 , encoding: D W _ A T E _ u n s i g n e d )
!28 = !DIExpression ( )
!29 = !DILocation ( line: 3 , scope: !11 )
!30 = !DILocation ( line: 4 , scope: !5 )