• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; 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:
9;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
13
14define void @f() !dbg !4 {
15  ret void, !dbg !14
16}
17
18define void @g() !dbg !11 {
19  ret void, !dbg !15
20}
21
22!llvm.dbg.cu = !{!0, !8}
23!llvm.module.flags = !{!13, !16}
24
25!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)
26!1 = !DIFile(filename: "test1.c", directory: "/tmp")
27!2 = !{}
28!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)
29!5 = !DIFile(filename: "test1.c", directory: "/tmp")
30!6 = !DISubroutineType(types: !7)
31!7 = !{null}
32!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)
33!9 = !DIFile(filename: "test2.c", directory: "/tmp")
34!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)
35!12 = !DIFile(filename: "test2.c", directory: "/tmp")
36!13 = !{i32 2, !"Dwarf Version", i32 4}
37!14 = !DILocation(line: 1, scope: !4)
38!15 = !DILocation(line: 1, scope: !11)
39!16 = !{i32 1, !"Debug Info Version", i32 3}
40