blob: 703773b870510c5c65c763449ccd572dccd0a90a [file] [log] [blame]
Bill Wendlingbfc0e572012-12-04 06:20:49 +00001; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -o %t < %s
Eli Benderskye6abe832013-01-25 21:44:53 +00002; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
Bill Wendlingbfc0e572012-12-04 06:20:49 +00003; <rdar://problem/12566646>
4
Adrian Prantl1eadba12016-12-22 00:45:21 +00005source_filename = "test/DebugInfo/X86/empty-array.ll"
6
Bill Wendlingbfc0e572012-12-04 06:20:49 +00007%class.A = type { [0 x i32] }
8
Adrian Prantl1eadba12016-12-22 00:45:21 +00009@a = global %class.A zeroinitializer, align 4, !dbg !0
Manman Renf4c339e2013-10-29 22:49:29 +000010; CHECK: DW_TAG_class_type
11; CHECK: DW_TAG_member
12; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "x")
13; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[ARRAY:0x[0-9a-f]*]]})
14
15; CHECK: [[ARRAY]]: DW_TAG_array_type [{{.*}}] *
16; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[BASETYPE:0x[0-9a-f]*]]})
17
18; CHECK: DW_TAG_subrange_type
19; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[BASE2:0x[0-9a-f]*]]})
20; CHECK-NOT: DW_AT_upper_bound
21
22; CHECK: [[BASETYPE]]: DW_TAG_base_type
23; CHECK: [[BASE2]]: DW_TAG_base_type
Eric Christophercad9b532013-01-04 21:51:53 +000024; CHECK-NEXT: DW_AT_name
David Blaikie12e00fc2014-04-03 06:28:20 +000025; CHECK-NEXT: DW_AT_byte_size [DW_FORM_data1] (0x08)
Frederic Riss878065b2014-09-04 19:39:20 +000026; CHECK-NEXT: DW_AT_encoding [DW_FORM_data1] (DW_ATE_unsigned)
Bill Wendlingbfc0e572012-12-04 06:20:49 +000027
Adrian Prantl1eadba12016-12-22 00:45:21 +000028!llvm.dbg.cu = !{!14}
29!llvm.module.flags = !{!17}
Bill Wendlingbfc0e572012-12-04 06:20:49 +000030
Adrian Prantl1eadba12016-12-22 00:45:21 +000031!0 = !DIGlobalVariableExpression(var: !1)
32!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
33!2 = !DIFile(filename: "t.cpp", directory: "/Volumes/Sandbox/llvm")
34!3 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !2, line: 1, align: 32, elements: !4)
35!4 = !{!5, !10}
36!5 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !3, file: !2, line: 1, baseType: !6, flags: DIFlagPrivate)
37!6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, align: 32, elements: !8)
38!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
39!8 = !{!9}
40!9 = !DISubrange(count: -1)
41!10 = !DISubprogram(name: "A", scope: !3, file: !2, line: 1, type: !11, isLocal: false, isDefinition: false, scopeLine: 1, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
42!11 = !DISubroutineType(types: !12)
43!12 = !{null, !13}
44!13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
45!14 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !15, retainedTypes: !15, globals: !16, imports: !15)
46!15 = !{}
47!16 = !{!0}
48!17 = !{i32 1, !"Debug Info Version", i32 3}
49