Index: lib/CodeGen/CGDebugInfo.cpp =================================================================== --- lib/CodeGen/CGDebugInfo.cpp +++ lib/CodeGen/CGDebugInfo.cpp @@ -365,7 +365,8 @@ CGDebugInfo::computeChecksum(FileID FID, SmallString<32> &Checksum) const { Checksum.clear(); - if (!CGM.getCodeGenOpts().EmitCodeView) + if (!CGM.getCodeGenOpts().EmitCodeView && + CGM.getCodeGenOpts().DwarfVersion < 5) return llvm::DIFile::CSK_None; SourceManager &SM = CGM.getContext().getSourceManager(); Index: test/CodeGen/debug-info-file-checksum.c =================================================================== --- test/CodeGen/debug-info-file-checksum.c +++ test/CodeGen/debug-info-file-checksum.c @@ -1,4 +1,5 @@ // RUN: %clang -emit-llvm -S -g -gcodeview -x c %S/Inputs/debug-info-file-checksum.c -o - | FileCheck %s +// RUN: %clang -emit-llvm -S -gdwarf-5 -x c %S/Inputs/debug-info-file-checksum.c -o - | FileCheck %s // Check that "checksum" is created correctly for the compiled file.