[PATCH] D26443: [ELF] - Use backward slashes inside response files

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 02:26:59 PST 2016


grimar created this revision.
grimar added reviewers: ruiu, rafael, davide.
grimar added subscribers: llvm-commits, grimar, evgeny777.

Patch replaces forward slashes with backward inside response.txt

This is https://llvm.org/bugs/show_bug.cgi?id=30951.


https://reviews.llvm.org/D26443

Files:
  lib/Core/Reproduce.cpp
  test/ELF/reproduce-windows2.s


Index: test/ELF/reproduce-windows2.s
===================================================================
--- test/ELF/reproduce-windows2.s
+++ test/ELF/reproduce-windows2.s
@@ -0,0 +1,11 @@
+# REQUIRES: x86, cpio
+
+# Test that a response.txt file always uses / instead of \.
+# RUN: rm -rf %t.dir
+# RUN: mkdir -p %t.dir/build
+# RUN: llvm-mc %s -o %t.dir/build/foo.o -filetype=obj -triple=x86_64-pc-linux
+# RUN: cd %t.dir
+# RUN: ld.lld build/foo.o --reproduce repro
+# RUN: echo "*response.txt" > list.txt
+# RUN: cpio -i --to-stdout --pattern-file=list.txt < repro.cpio | FileCheck %s
+# CHECK: {{.*}}/build/foo.o
Index: lib/Core/Reproduce.cpp
===================================================================
--- lib/Core/Reproduce.cpp
+++ lib/Core/Reproduce.cpp
@@ -93,6 +93,7 @@
     Res = Root.substr(2);
 
   path::append(Res, path::relative_path(Abs));
+  std::replace(Res.begin(), Res.end(), '\\', '/');
 
   return Res.str();
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26443.77324.patch
Type: text/x-patch
Size: 944 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161109/be2619ba/attachment.bin>


More information about the llvm-commits mailing list