71 lines · plain
1; AIX doesn't support the debug_addr section2; UNSUPPORTED: target={{.*}}-aix{{.*}}3 4; RUN: %llc_dwarf -O0 -filetype=obj -o - < %s | llvm-dwarfdump -debug-line - | FileCheck %s5 6; CHECK: include_directories[ 0] = "dir"7; CHECK-NEXT: file_names[ 0]:8; CHECK-NEXT: name: "main.c"9; CHECK-NEXT: dir_index: 010; CHECK-NOT: source:11; CHECK-NEXT: file_names[ 1]:12; CHECK-NEXT: name: "foo.c"13; CHECK-NEXT: dir_index: 014; CHECK-NEXT: source: "void foo() { }\n"15; CHECK-NEXT: file_names[ 2]:16; CHECK-NEXT: name: "newline.h"17; CHECK-NEXT: dir_index: 018; CHECK-NEXT: source: "\n"19; CHECK-NEXT: file_names[ 3]:20; CHECK-NEXT: name: "empty.h"21; CHECK-NEXT: dir_index: 022; CHECK-NEXT: source: "\n"23; CHECK-NEXT: file_names[ 4]:24; CHECK-NEXT: name: "absent.h"25; CHECK-NEXT: dir_index: 026; CHECK-NOT: source:27 28; Test that DIFiles mixing source and no-source within a DICompileUnit works.29 30define dso_local void @foo() !dbg !6 {31 ret void, !dbg !732}33 34define dso_local void @newline() !dbg !9 {35 ret void, !dbg !1036}37 38define dso_local void @empty() !dbg !12 {39 ret void, !dbg !1340}41 42define dso_local void @absent() !dbg !15 {43 ret void, !dbg !1644}45 46!llvm.dbg.cu = !{!2}47!llvm.module.flags = !{!0, !1}48 49!0 = !{i32 2, !"Dwarf Version", i32 5}50!1 = !{i32 2, !"Debug Info Version", i32 3}51 52!2 = distinct !DICompileUnit(language: DW_LANG_C99, emissionKind: FullDebug, file: !4)53!3 = !DISubroutineType(types: !{})54!4 = !DIFile(filename: "main.c", directory: "dir")55 56!5 = !DIFile(filename: "foo.c", directory: "dir", source: "void foo() { }\0A")57!6 = distinct !DISubprogram(name: "foo", file: !5, line: 1, type: !3, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2)58!7 = !DILocation(line: 1, scope: !6)59 60!8 = !DIFile(filename: "newline.h", directory: "dir", source: "\0A")61!9 = distinct !DISubprogram(name: "newline", file: !8, line: 1, type: !3, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2)62!10 = !DILocation(line: 1, scope: !9)63 64!11 = !DIFile(filename: "empty.h", directory: "dir", source: "")65!12 = distinct !DISubprogram(name: "empty", file: !11, line: 1, type: !3, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2)66!13 = !DILocation(line: 1, scope: !12)67 68!14 = !DIFile(filename: "absent.h", directory: "dir")69!15 = distinct !DISubprogram(name: "absent", file: !14, line: 1, type: !3, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2)70!16 = !DILocation(line: 1, scope: !15)71