xref: /llvm-project/llvm/test/DebugInfo/Generic/mixed-source.ll (revision 70187ebadf20f014a7821cf322eae60192dbe4cc)
1; AIX doesn't support the debug_addr section
2; UNSUPPORTED:  target={{.*}}-aix{{.*}}
3
4; RUN: %llc_dwarf -O0 -filetype=obj -o - < %s | llvm-dwarfdump -debug-line - | FileCheck %s
5
6; CHECK: include_directories[  0] = "dir"
7; CHECK-NEXT: file_names[  0]:
8; CHECK-NEXT:            name: "foo.c"
9; CHECK-NEXT:       dir_index: 0
10; CHECK-NEXT:          source: "void foo() { }\n"
11; CHECK-NEXT: file_names[  1]:
12; CHECK-NEXT:            name: "bar.h"
13; CHECK-NEXT:       dir_index: 0
14; CHECK-NOT:           source:
15
16; Test that DIFiles mixing source and no-source within a DICompileUnit works.
17
18define dso_local void @foo() !dbg !5 {
19  ret void, !dbg !7
20}
21
22define dso_local void @bar() !dbg !6 {
23  ret void, !dbg !8
24}
25
26!llvm.dbg.cu = !{!4}
27!llvm.module.flags = !{!0, !1}
28
29!0 = !{i32 2, !"Dwarf Version", i32 5}
30!1 = !{i32 2, !"Debug Info Version", i32 3}
31
32!2 = !DIFile(filename: "foo.c", directory: "dir", source: "void foo() { }\0A")
33!3 = !DIFile(filename: "bar.h", directory: "dir")
34
35!4 = distinct !DICompileUnit(language: DW_LANG_C99, emissionKind: FullDebug, file: !2)
36!5 = distinct !DISubprogram(name: "foo", file: !2, line: 1, type: !9, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !4)
37!6 = distinct !DISubprogram(name: "bar", file: !3, line: 1, type: !9, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !4)
38!7 = !DILocation(line: 1, scope: !5)
39!8 = !DILocation(line: 1, scope: !6)
40!9 = !DISubroutineType(types: !{})
41