2012-12-04 14:20:49 +08:00
; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -o %t < %s
2013-01-26 05:44:53 +08:00
; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
2012-12-04 14:20:49 +08:00
; <rdar://problem/12566646>
2016-12-22 08:45:21 +08:00
source_filename = "test/DebugInfo/X86/empty-array.ll"
2012-12-04 14:20:49 +08:00
2016-12-22 08:45:21 +08:00
%class.A = type { [ 0 x i32 ] }
2012-12-04 14:20:49 +08:00
2016-12-22 08:45:21 +08:00
@a = global %class.A zeroinitializer , align 4 , !dbg !0
2013-10-30 06:49:29 +08:00
; CHECK: DW_TAG_class_type
; CHECK: DW_TAG_member
; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "x")
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[ARRAY:0x[0-9a-f]*]]})
2012-12-04 14:20:49 +08:00
2013-10-30 06:49:29 +08:00
; CHECK: [[ARRAY]]: DW_TAG_array_type [{{.*}}] *
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[BASETYPE:0x[0-9a-f]*]]})
2012-12-04 14:20:49 +08:00
2013-10-29 13:49:41 +08:00
; CHECK: DW_TAG_subrange_type
2013-10-30 06:49:29 +08:00
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[BASE2:0x[0-9a-f]*]]})
2012-12-05 05:34:03 +08:00
; CHECK-NOT: DW_AT_upper_bound
2012-12-04 14:20:49 +08:00
2013-10-30 06:49:29 +08:00
; CHECK: [[BASETYPE]]: DW_TAG_base_type
; CHECK: [[BASE2]]: DW_TAG_base_type
; CHECK-NEXT: DW_AT_name
2014-04-03 14:28:20 +08:00
; CHECK-NEXT: DW_AT_byte_size [DW_FORM_data1] (0x08)
2014-09-05 03:39:20 +08:00
; CHECK-NEXT: DW_AT_encoding [DW_FORM_data1] (DW_ATE_unsigned)
2012-12-04 14:20:49 +08:00
2016-12-22 08:45:21 +08:00
!llvm.dbg.cu = ! { !14 }
!llvm.module.flags = ! { !17 }
!0 = !DIGlobalVariableExpression ( var: !1 )
!1 = !DIGlobalVariable ( name: "a" , scope: null , file: !2 , line: 1 , type: !3 , isLocal: false , isDefinition: true )
!2 = !DIFile ( filename: "t.cpp" , directory: "/Volumes/Sandbox/llvm" )
!3 = !DICompositeType ( tag: D W _ T A G _ c l a s s _ type , name: "A" , file: !2 , line: 1 , align: 32 , elements: !4 )
!4 = ! { !5 , !10 }
!5 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "x" , scope: !3 , file: !2 , line: 1 , baseType: !6 , flags: D I F l a g P r i v a t e )
!6 = !DICompositeType ( tag: D W _ T A G _ a r r a y _ type , baseType: !7 , align: 32 , elements: !8 )
!7 = !DIBasicType ( name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
!8 = ! { !9 }
!9 = !DISubrange ( count: -1 )
!10 = !DISubprogram ( name: "A" , scope: !3 , file: !2 , line: 1 , type: !11 , isLocal: false , isDefinition: false , scopeLine: 1 , virtualIndex: 6 , flags: D I F l a g A r t i f i c i a l | D I F l a g P r o t o t y p e d , isOptimized: false )
!11 = !DISubroutineType ( types: !12 )
!12 = ! { null , !13 }
!13 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , baseType: !3 , size: 64 , align: 64 , flags: D I F l a g A r t i f i c i a l | D I F l a g O b j e c t P o i n t e r )
!14 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , file: !2 , producer: "clang version 3.3 (trunk 169136)" , isOptimized: false , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !15 , retainedTypes: !15 , globals: !16 , imports: !15 )
!15 = ! { }
!16 = ! { !0 }
!17 = ! { i32 1 , !"Debug Info Version" , i32 3 }