[PATCH] D65734: [llvm-objdump] Quote filename to fix windows test failure

Mike Pozulp via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 4 22:08:15 PDT 2019


mmpozulp created this revision.
mmpozulp added reviewers: dyung, jhenderson.
Herald added subscribers: llvm-commits, rupprecht.
Herald added a project: LLVM.

Attempts to fix buildbot failure
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/27368
which Douglas Yung alerted me to. Doug observed that:
2 tests modified r367776 are failing when run on a Windows bot. 
It seems to be due to the [[FILE]] substitution escaping characters 
and then expecting the output generated to match it which it does 
not since things are then doubly escaped.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65734

Files:
  llvm/test/tools/llvm-objdump/X86/source-interleave-invalid-source.test
  llvm/test/tools/llvm-objdump/X86/source-interleave-missing-source.test
  llvm/test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test
  llvm/tools/llvm-objdump/llvm-objdump.cpp


Index: llvm/tools/llvm-objdump/llvm-objdump.cpp
===================================================================
--- llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -581,7 +581,8 @@
     auto BufferOrError = MemoryBuffer::getFile(LineInfo.FileName);
     if (!BufferOrError) {
       if (MissingSources.insert(LineInfo.FileName).second)
-        warn("failed to find source " + LineInfo.FileName);
+        warn(formatv("failed to find source '{0}'", LineInfo.FileName));
+
       return false;
     }
     Buffer = std::move(*BufferOrError);
@@ -619,8 +620,8 @@
 
   if (LineInfo.FileName == DILineInfo::BadString) {
     if (!WarnedNoDebugInfo) {
-      std::string Warning =
-          "failed to parse debug information for " + ObjectFilename.str();
+      std::string Warning = formatv(
+          "failed to parse debug information for '{0}'", ObjectFilename.str());
       if (!ErrorMessage.empty())
         Warning += ": " + ErrorMessage;
       warn(Warning);
@@ -643,7 +644,7 @@
     if (LineBuffer != LineCache.end()) {
       if (LineInfo.Line > LineBuffer->second.size()) {
         warn(formatv(
-            "debug info line number {0} exceeds the number of lines in {1}",
+            "debug info line number {0} exceeds the number of lines in '{1}'",
             LineInfo.Line, LineInfo.FileName));
         return;
       }
Index: llvm/test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test
===================================================================
--- llvm/test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test
+++ llvm/test/tools/llvm-objdump/X86/source-interleave-no-debug-info.test
@@ -9,7 +9,7 @@
 # RUN: llvm-objdump --source %t2.o 2> %t2.e | FileCheck %s --check-prefixes=CHECK --implicit-check-not='main()'
 # RUN: FileCheck %s --input-file %t2.e --check-prefixes=WARN -DFILE=%t2.o
 
-# WARN:        warning: failed to parse debug information for [[FILE]]
+# WARN:        warning: failed to parse debug information for '[[FILE]]'
 # CHECK:       0000000000000010 main:
 # SOURCE-NEXT: ; int main() {
 # CHECK-NEXT:   10:   55                      pushq   %rbp
Index: llvm/test/tools/llvm-objdump/X86/source-interleave-missing-source.test
===================================================================
--- llvm/test/tools/llvm-objdump/X86/source-interleave-missing-source.test
+++ llvm/test/tools/llvm-objdump/X86/source-interleave-missing-source.test
@@ -11,7 +11,7 @@
 # RUN: llvm-objdump --source %t2.o | FileCheck %s --check-prefixes=CHECK,SOURCE
 # RUN: FileCheck %s --input-file %t.e --check-prefixes=WARN -DFILE=%t/source-interleave-x86_64.c
 
-# WARN:        warning: failed to find source [[FILE]]
+# WARN:        warning: failed to find source '[[FILE]]'
 # CHECK:       0000000000000010 main:
 # SOURCE-NEXT: ; int main() {
 # CHECK-NEXT:   10:   55                      pushq   %rbp
Index: llvm/test/tools/llvm-objdump/X86/source-interleave-invalid-source.test
===================================================================
--- llvm/test/tools/llvm-objdump/X86/source-interleave-invalid-source.test
+++ llvm/test/tools/llvm-objdump/X86/source-interleave-invalid-source.test
@@ -13,6 +13,6 @@
 
 # CHECK:      main:
 # CHECK-NEXT: ; int main() {
-# WARN:       warning: debug info line number 9999 exceeds the number of lines in [[FILE]]
+# WARN:       warning: debug info line number 9999 exceeds the number of lines in '[[FILE]]'
 # GOOD:       ;   int *b = &a;
 # CHECK:      ;   return *b + foo();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65734.213282.patch
Type: text/x-patch
Size: 3525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190805/0ec26a81/attachment.bin>


More information about the llvm-commits mailing list