xref: /aosp_15_r20/external/llvm/test/DebugInfo/Generic/debuginfofinder-multiple-cu.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt -analyze -module-debuginfo < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; Produced from linking:
4*9880d681SAndroid Build Coastguard Worker;   /tmp/test1.c containing f()
5*9880d681SAndroid Build Coastguard Worker;   /tmp/test2.c containing g()
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; Verify that both compile units and both their contained functions are
8*9880d681SAndroid Build Coastguard Worker; listed by DebugInfoFinder:
9*9880d681SAndroid Build Coastguard Worker;CHECK: Compile unit: DW_LANG_C99 from /tmp/test1.c
10*9880d681SAndroid Build Coastguard Worker;CHECK: Compile unit: DW_LANG_C99 from /tmp/test2.c
11*9880d681SAndroid Build Coastguard Worker;CHECK: Subprogram: f from /tmp/test1.c:1
12*9880d681SAndroid Build Coastguard Worker;CHECK: Subprogram: g from /tmp/test2.c:1
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine void @f() !dbg !4 {
15*9880d681SAndroid Build Coastguard Worker  ret void, !dbg !14
16*9880d681SAndroid Build Coastguard Worker}
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerdefine void @g() !dbg !11 {
19*9880d681SAndroid Build Coastguard Worker  ret void, !dbg !15
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0, !8}
23*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!13, !16}
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Worker!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*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "test1.c", directory: "/tmp")
27*9880d681SAndroid Build Coastguard Worker!2 = !{}
28*9880d681SAndroid Build Coastguard Worker!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*9880d681SAndroid Build Coastguard Worker!5 = !DIFile(filename: "test1.c", directory: "/tmp")
30*9880d681SAndroid Build Coastguard Worker!6 = !DISubroutineType(types: !7)
31*9880d681SAndroid Build Coastguard Worker!7 = !{null}
32*9880d681SAndroid Build Coastguard Worker!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*9880d681SAndroid Build Coastguard Worker!9 = !DIFile(filename: "test2.c", directory: "/tmp")
34*9880d681SAndroid Build Coastguard Worker!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*9880d681SAndroid Build Coastguard Worker!12 = !DIFile(filename: "test2.c", directory: "/tmp")
36*9880d681SAndroid Build Coastguard Worker!13 = !{i32 2, !"Dwarf Version", i32 4}
37*9880d681SAndroid Build Coastguard Worker!14 = !DILocation(line: 1, scope: !4)
38*9880d681SAndroid Build Coastguard Worker!15 = !DILocation(line: 1, scope: !11)
39*9880d681SAndroid Build Coastguard Worker!16 = !{i32 1, !"Debug Info Version", i32 3}
40