Index: llvm/lib/MC/MCAsmStreamer.cpp =================================================================== --- llvm/lib/MC/MCAsmStreamer.cpp +++ llvm/lib/MC/MCAsmStreamer.cpp @@ -1161,6 +1161,9 @@ if (getContext().getDwarfVersion() < 5) return; + MCStreamer::emitDwarfFile0Directive(Directory, Filename, Checksum, Source, + CUID); + SmallString<128> Str; raw_svector_ostream OS1(Str); printDwarfFileDirective(0, Directory, Filename, Checksum, Source, Index: llvm/test/CodeGen/Generic/dwarf-md5.ll =================================================================== --- llvm/test/CodeGen/Generic/dwarf-md5.ll +++ llvm/test/CodeGen/Generic/dwarf-md5.ll @@ -14,10 +14,10 @@ ; ASM-4-NOT: .file 0 ; ASM-5: .file 0 "/scratch{{.*[/\\]}}t.c" md5 0x00000000000000000000000000000000 -; ASM: .file 1 "/scratch{{.*[/\\]}}t1.h" +; ASM: .file 1 "{{.*}}t1.h" ; ASM-4-NOT: md5 ; ASM-5-SAME: md5 0x11111111111111111111111111111111 -; ASM: .file 2 "/scratch{{.*[/\\]}}t2.h" +; ASM: .file 2 "{{.*}}t2.h" ; ASM-4-NOT: md5 ; ASM-5-SAME: md5 0x22222222222222222222222222222222 Index: llvm/test/CodeGen/Generic/dwarf-source.ll =================================================================== --- llvm/test/CodeGen/Generic/dwarf-source.ll +++ llvm/test/CodeGen/Generic/dwarf-source.ll @@ -5,16 +5,19 @@ ; XFAIL: darwin ; REQUIRES: object-emission -; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM -; RUN: %llc_dwarf -dwarf-version 5 -filetype=asm -o - %s | FileCheck %s --check-prefixes=ASM,ASM-5 +; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM-4 +; RUN: %llc_dwarf -dwarf-version 5 -filetype=asm -o - %s | FileCheck %s --check-prefixes=ASM-5 ; RUN: %llc_dwarf -dwarf-version 4 -filetype=obj -o %t4.o %s ; RUN: llvm-dwarfdump -debug-line %t4.o | FileCheck %s --check-prefixes=OBJ,OBJ-4 ; RUN: %llc_dwarf -dwarf-version 5 -filetype=obj -o %t5.o %s ; RUN: llvm-dwarfdump -debug-line %t5.o | FileCheck %s --check-prefixes=OBJ,OBJ-5 +; ASM-4: .file 1 "/test{{.*[/\\]}}t1.h" source "11111111111111111111111111111111" +; ASM-4: .file 2 "/test{{.*[/\\]}}t2.h" source "22222222222222222222222222222222" + ; ASM-5: .file 0 "/test{{.*[/\\]}}t.c" source "00000000000000000000000000000000" -; ASM: .file 1 "/test{{.*[/\\]}}t1.h" source "11111111111111111111111111111111" -; ASM: .file 2 "/test{{.*[/\\]}}t2.h" source "22222222222222222222222222222222" +; ASM-5: .file 1 "t1.h" source "11111111111111111111111111111111" +; ASM-5: .file 2 "t2.h" source "22222222222222222222222222222222" ; OBJ-5: file_names[ 0]: ; OBJ-5-NEXT: name: "t.c"