blob: f6c79f77c6f289c092893a0fe4aec9581e808bb7 [file] [log] [blame]
Timur Iskhodzhanovf166f6c2014-01-30 01:39:17 +00001; RUN: %llc_dwarf -O0 < %s | FileCheck %s
Devang Patele3964792011-04-08 21:55:10 +00002; Do not emit AT_upper_bound for an unbounded array.
Devang Patel12599c22011-04-08 23:52:04 +00003; radar 9241695
Devang Patele3964792011-04-08 21:55:10 +00004define i32 @main() nounwind ssp {
5entry:
6 %retval = alloca i32, align 4
7 %a = alloca [0 x i32], align 4
8 store i32 0, i32* %retval
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +00009 call void @llvm.dbg.declare(metadata [0 x i32]* %a, metadata !6, metadata !DIExpression()), !dbg !11
Devang Patele3964792011-04-08 21:55:10 +000010 ret i32 0, !dbg !12
11}
12
Adrian Prantl87b7eb92014-10-01 18:55:02 +000013declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
Devang Patele3964792011-04-08 21:55:10 +000014
David Blaikiee5a2f702013-03-08 00:23:31 +000015!llvm.dbg.cu = !{!2}
Manman Ren409558f2013-11-22 21:49:45 +000016!llvm.module.flags = !{!16}
Devang Patele3964792011-04-08 21:55:10 +000017
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000018!0 = !DISubprogram(name: "main", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 3, file: !14, scope: !1, type: !3, function: i32 ()* @main)
19!1 = !DIFile(filename: "array.c", directory: "/private/tmp")
20!2 = !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.0 (trunk 129138)", isOptimized: false, emissionKind: 0, file: !14, enums: !15, retainedTypes: !15, subprograms: !13, imports: null)
21!3 = !DISubroutineType(types: !4)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000022!4 = !{!5}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000023!5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
24!6 = !DILocalVariable(tag: DW_TAG_auto_variable, name: "a", line: 4, scope: !7, file: !1, type: !8)
25!7 = distinct !DILexicalBlock(line: 3, column: 12, file: !14, scope: !0)
26!8 = !DICompositeType(tag: DW_TAG_array_type, align: 32, file: !14, scope: !2, baseType: !5, elements: !9)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000027!9 = !{!10}
Rafael Espindolaf1a13f52015-03-11 00:51:37 +000028;CHECK: section_info:
Devang Patele3964792011-04-08 21:55:10 +000029;CHECK: DW_TAG_subrange_type
30;CHECK-NEXT: DW_AT_type
31;CHECK-NOT: DW_AT_lower_bound
32;CHECK-NOT: DW_AT_upper_bound
33;CHECK-NEXT: End Of Children Mark
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000034!10 = !DISubrange(count: -1)
35!11 = !DILocation(line: 4, column: 7, scope: !7)
36!12 = !DILocation(line: 5, column: 3, scope: !7)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000037!13 = !{!0}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000038!14 = !DIFile(filename: "array.c", directory: "/private/tmp")
Duncan P. N. Exon Smith988a7f82015-03-27 20:46:33 +000039!15 = !{}
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000040!16 = !{i32 1, !"Debug Info Version", i32 3}