diff --git a/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test b/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test index 43d930af71280..a16330d8c1b05 100644 --- a/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test +++ b/llvm/test/tools/dsymutil/X86/swift-ast-x86_64.test @@ -1,4 +1,5 @@ RUN: dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.x86_64 -o %T/swift-ast.dSYM -verbose -no-swiftmodule-timestamp | FileCheck %s --check-prefix=DSYMUTIL +RUN: dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.x86_64 -o %T/swift-ast.dSYM -verbose | FileCheck %s --check-prefix=DSYMUTIL RUN: llvm-readobj --sections --section-data %T/swift-ast.dSYM/Contents/Resources/DWARF/swift-ast.macho.x86_64 | FileCheck %s --check-prefix=READOBJ RUN: llvm-dwarfdump --show-section-sizes %T/swift-ast.dSYM/Contents/Resources/DWARF/swift-ast.macho.x86_64 | FileCheck %s --check-prefix=DWARFDUMP @@ -11,6 +12,7 @@ Compiled with: DSYMUTIL: filename:{{.*}}swift-ast.swiftmodule DSYMUTIL-NOT: The file was not recognized as a valid object file +DSYMUTIL-NOT: timestamp mismatch DSYMUTIL: DEBUG MAP OBJECT:{{.*}}swift-ast.swiftmodule READOBJ: Name:{{.*}}__swift_ast @@ -19,8 +21,5 @@ READOBJ-NEXT: |.| DWARFDUMP: __swift_ast -RUN: dsymutil -oso-prepend-path %p/.. %p/../Inputs/swift-ast.macho.x86_64 -no-output -verbose 2>&1 | FileCheck %s --check-prefix=TIMESTAMP -TIMESTAMP: warning: {{.*}}/swift-ast.swiftmodule: timestamp mismatch between swift interface file ({{.*}}) and debug map ({{.*}}) - RUN: dsymutil -s %T/swift-ast.dSYM/Contents/Resources/DWARF/swift-ast.macho.x86_64 | FileCheck %s --check-prefix=NAST NAST-NOT: N_AST diff --git a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp index 809b5f799b068..a8dfde0865377 100644 --- a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp +++ b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp @@ -414,7 +414,8 @@ bool DwarfLinkerForBinary::link(const DebugMap &Map) { auto ModificationTime = std::chrono::time_point_cast( Stat.getLastModificationTime()); - if (ModificationTime != Obj->getTimestamp()) { + if (Obj->getTimestamp() != sys::TimePoint<>() && + ModificationTime != Obj->getTimestamp()) { // Not using the helper here as we can easily stream TimePoint<>. WithColor::warning() << File << ": timestamp mismatch between swift interface file ("