[lld] r268596 - Add a test for --reproduce on Windows.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 19:18:04 PDT 2016


Author: ruiu
Date: Wed May  4 21:18:04 2016
New Revision: 268596

URL: http://llvm.org/viewvc/llvm-project?rev=268596&view=rev
Log:
Add a test for --reproduce on Windows.

It is insanely hard to write a test that works both on Windows and Unix.
I tried to workaround it with cpio's minor options, but the behaviors of
the options were myterious. It just doesn't worth to spend time on it.
And probably minor options could break buildbots that doesn't have the
GNU version of cpio command.

In this patch, I simply added a separate test file that runs only on
Windows.

Added:
    lld/trunk/test/ELF/reproduce-win32.s
Modified:
    lld/trunk/test/lit.cfg

Added: lld/trunk/test/ELF/reproduce-win32.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/reproduce-win32.s?rev=268596&view=auto
==============================================================================
--- lld/trunk/test/ELF/reproduce-win32.s (added)
+++ lld/trunk/test/ELF/reproduce-win32.s Wed May  4 21:18:04 2016
@@ -0,0 +1,12 @@
+# REQUIRES: x86, system-windows
+
+# RUN: rm -rf %t.dir
+# RUN: mkdir -p %t.dir/build
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.dir/build/foo.o
+# RUN: cd %t.dir
+# RUN: ld.lld --hash-style=gnu build/foo.o -o bar --reproduce repro
+# RUN: cpio -t < repro.cpio | grep -F 'repro\%:t.dir\build\foo.o' -
+
+.globl _start
+_start:
+  ret

Modified: lld/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/lit.cfg?rev=268596&r1=268595&r2=268596&view=diff
==============================================================================
--- lld/trunk/test/lit.cfg (original)
+++ lld/trunk/test/lit.cfg Wed May  4 21:18:04 2016
@@ -195,6 +195,10 @@ if execute_external:
 if platform.system() in ['Darwin']:
     config.available_features.add('system-linker-mach-o')
 
+# Running on Windows
+if platform.system() in ['Windows'] and re.match(r'.*-win32$', config.target_triple):
+    config.available_features.add('system-windows')
+
 # Running on ELF based *nix
 if platform.system() in ['FreeBSD', 'Linux']:
     config.available_features.add('system-linker-elf')




More information about the llvm-commits mailing list