• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -analyze -module-debuginfo -enable-new-pm=0 < %s | FileCheck %s
2; RUN: opt -passes='print<module-debuginfo>' -disable-output 2>&1 < %s \
3; RUN:   | FileCheck %s
4
5; Produced from linking:
6;   /tmp/test1.c containing f()
7;   /tmp/test2.c containing g()
8
9; Verify that both compile units and both their contained functions are
10; listed by DebugInfoFinder:
11;CHECK: Compile unit: DW_LANG_C99 from /tmp/test1.c
12;CHECK: Compile unit: DW_LANG_C99 from /tmp/test2.c
13;CHECK: Subprogram: f from /tmp/test1.c:1
14;CHECK: Subprogram: g from /tmp/test2.c:1
15
16define void @f() !dbg !4 {
17  ret void, !dbg !14
18}
19
20define void @g() !dbg !11 {
21  ret void, !dbg !15
22}
23
24!llvm.dbg.cu = !{!0, !8}
25!llvm.module.flags = !{!13, !16}
26
27!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)
28!1 = !DIFile(filename: "test1.c", directory: "/tmp")
29!2 = !{}
30!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, retainedNodes: !2)
31!5 = !DIFile(filename: "test1.c", directory: "/tmp")
32!6 = !DISubroutineType(types: !7)
33!7 = !{null}
34!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)
35!9 = !DIFile(filename: "test2.c", directory: "/tmp")
36!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, retainedNodes: !2)
37!12 = !DIFile(filename: "test2.c", directory: "/tmp")
38!13 = !{i32 2, !"Dwarf Version", i32 4}
39!14 = !DILocation(line: 1, scope: !4)
40!15 = !DILocation(line: 1, scope: !11)
41!16 = !{i32 1, !"Debug Info Version", i32 3}
42