blob: 6ccab8599dfd8836a43047e3a378802f461bb2cc [file] [log] [blame]
David Blaikie6a439ad2013-12-04 18:40:29 +00001; REQUIRES: object-emission
Devang Patel1a0df9a2010-05-10 22:49:55 +00002
Timur Iskhodzhanovf166f6c2014-01-30 01:39:17 +00003; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=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
Devang Patel1a0df9a2010-05-10 22:49:55 +000010define i32 @foo() nounwind readnone ssp {
11return:
12 ret i32 42, !dbg !0
13}
14
15define i32 @bar() nounwind readnone ssp {
16return:
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 Smith98854692015-01-14 22:27:36 +000025!0 = !MDLocation(line: 3, scope: !1)
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000026!1 = distinct !MDLexicalBlock(line: 2, column: 0, file: !18, scope: !2)
27!2 = !MDSubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !18, scope: !3, type: !5, function: i32 ()* @foo)
28!3 = !MDFile(filename: "a.c", directory: "/tmp/")
29!4 = !MDCompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !18, enums: !19, retainedTypes: !19, subprograms: !16)
30!5 = !MDSubroutineType(types: !6)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000031!6 = !{!7}
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000032!7 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
Duncan P. N. Exon Smith98854692015-01-14 22:27:36 +000033!8 = !MDLocation(line: 3, scope: !9)
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000034!9 = distinct !MDLexicalBlock(line: 2, column: 0, file: !20, scope: !10)
35!10 = !MDSubprogram(name: "bar", linkageName: "bar", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !20, scope: !11, type: !13, function: i32 ()* @bar)
36!11 = !MDFile(filename: "b.c", directory: "/tmp/")
37!12 = !MDCompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 0, file: !20, enums: !19, retainedTypes: !19, subprograms: !17)
38!13 = !MDSubroutineType(types: !14)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000039!14 = !{!15}
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000040!15 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
41!18 = !MDFile(filename: "a.c", directory: "/tmp/")
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000042!19 = !{i32 0}
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000043!20 = !MDFile(filename: "b.c", directory: "/tmp/")
44!21 = !{i32 1, !"Debug Info Version", i32 3}