blob: f3ae107644e86ef89666318d4458a61264e8f429 [file] [log] [blame]
David Blaikie6a439ad2013-12-04 18:40:29 +00001; REQUIRES: object-emission
Devang Patel1a0df9a2010-05-10 22:49:55 +00002
Adrian Prantl7bc1b282017-09-11 22:59:45 +00003; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
Jakob Stoklund Olesenf28cc032010-10-15 16:06:42 +00004
David Blaikie6a439ad2013-12-04 18:40:29 +00005; Check that two compile units are generated
Jakob Stoklund Olesenf28cc032010-10-15 16:06:42 +00006
David Blaikie6a439ad2013-12-04 18:40:29 +00007; CHECK: Compile Unit:
8; CHECK: Compile Unit:
Jakob Stoklund Olesenf28cc032010-10-15 16:06:42 +00009
Peter Collingbourned4bff302015-11-05 22:03:56 +000010define i32 @foo() nounwind readnone ssp !dbg !2 {
Devang Patel1a0df9a2010-05-10 22:49:55 +000011return:
12 ret i32 42, !dbg !0
13}
14
Peter Collingbourned4bff302015-11-05 22:03:56 +000015define i32 @bar() nounwind readnone ssp !dbg !10 {
Devang Patel1a0df9a2010-05-10 22:49:55 +000016return:
17 ret i32 21, !dbg !8
18}
19
David Blaikiee5a2f702013-03-08 00:23:31 +000020!llvm.dbg.cu = !{!4, !12}
Manman Ren409558f2013-11-22 21:49:45 +000021!llvm.module.flags = !{!21}
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000022!16 = !{!2}
23!17 = !{!10}
David Blaikiee5a2f702013-03-08 00:23:31 +000024
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000025!0 = !DILocation(line: 3, scope: !1)
26!1 = distinct !DILexicalBlock(line: 2, column: 0, file: !18, scope: !2)
Adrian Prantl75819ae2016-04-15 15:57:41 +000027!2 = distinct !DISubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !4, file: !18, scope: !3, type: !5)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000028!3 = !DIFile(filename: "a.c", directory: "/tmp/")
Adrian Prantl75819ae2016-04-15 15:57:41 +000029!4 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: FullDebug, file: !18, enums: !19, retainedTypes: !19)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000030!5 = !DISubroutineType(types: !6)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000031!6 = !{!7}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000032!7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
33!8 = !DILocation(line: 3, scope: !9)
34!9 = distinct !DILexicalBlock(line: 2, column: 0, file: !20, scope: !10)
Adrian Prantl75819ae2016-04-15 15:57:41 +000035!10 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !12, file: !20, scope: !11, type: !13)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000036!11 = !DIFile(filename: "b.c", directory: "/tmp/")
Adrian Prantl75819ae2016-04-15 15:57:41 +000037!12 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: FullDebug, file: !20, enums: !19, retainedTypes: !19)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000038!13 = !DISubroutineType(types: !14)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000039!14 = !{!15}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000040!15 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
41!18 = !DIFile(filename: "a.c", directory: "/tmp/")
Duncan P. N. Exon Smith988a7f82015-03-27 20:46:33 +000042!19 = !{}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000043!20 = !DIFile(filename: "b.c", directory: "/tmp/")
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000044!21 = !{i32 1, !"Debug Info Version", i32 3}