blob: 9dcb98b79dd176c292650d811e9c0b96a47de92f [file] [log] [blame]
Manman Ren409558f2013-11-22 21:49:45 +00001; RUN: opt -analyze -module-debuginfo < %s | FileCheck %s
2
3; Produced from linking:
4; /tmp/test1.c containing f()
5; /tmp/test2.c containing g()
6
7; Verify that both compile units and both their contained functions are
8; listed by DebugInfoFinder:
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +00009;CHECK: Compile unit: DW_LANG_C99 from /tmp/test1.c
10;CHECK: Compile unit: DW_LANG_C99 from /tmp/test2.c
11;CHECK: Subprogram: f from /tmp/test1.c:1
12;CHECK: Subprogram: g from /tmp/test2.c:1
Manman Ren409558f2013-11-22 21:49:45 +000013
Peter Collingbourned4bff302015-11-05 22:03:56 +000014define void @f() !dbg !4 {
Manman Ren409558f2013-11-22 21:49:45 +000015 ret void, !dbg !14
16}
17
Peter Collingbourned4bff302015-11-05 22:03:56 +000018define void @g() !dbg !11 {
Manman Ren409558f2013-11-22 21:49:45 +000019 ret void, !dbg !15
20}
21
22!llvm.dbg.cu = !{!0, !8}
23!llvm.module.flags = !{!13, !16}
24
Adrian Prantl75819ae2016-04-15 15:57:41 +000025!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (192092)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000026!1 = !DIFile(filename: "test1.c", directory: "/tmp")
Duncan P. N. Exon Smith988a7f82015-03-27 20:46:33 +000027!2 = !{}
Adrian Prantl75819ae2016-04-15 15:57:41 +000028!4 = distinct !DISubprogram(name: "f", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000029!5 = !DIFile(filename: "test1.c", directory: "/tmp")
30!6 = !DISubroutineType(types: !7)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000031!7 = !{null}
Adrian Prantl75819ae2016-04-15 15:57:41 +000032!8 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (192092)", isOptimized: false, emissionKind: FullDebug, file: !9, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000033!9 = !DIFile(filename: "test2.c", directory: "/tmp")
Adrian Prantl75819ae2016-04-15 15:57:41 +000034!11 = distinct !DISubprogram(name: "g", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !8, scopeLine: 1, file: !9, scope: !12, type: !6, variables: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000035!12 = !DIFile(filename: "test2.c", directory: "/tmp")
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000036!13 = !{i32 2, !"Dwarf Version", i32 4}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000037!14 = !DILocation(line: 1, scope: !4)
38!15 = !DILocation(line: 1, scope: !11)
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000039!16 = !{i32 1, !"Debug Info Version", i32 3}