From ac75a2780919d67b0330e43fb533145f0f52d93e Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 5 May 2016 02:18:04 +0000 Subject: [PATCH] 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. llvm-svn: 268596 --- lld/test/ELF/reproduce-win32.s | 12 ++++++++++++ lld/test/lit.cfg | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 lld/test/ELF/reproduce-win32.s diff --git a/lld/test/ELF/reproduce-win32.s b/lld/test/ELF/reproduce-win32.s new file mode 100644 index 000000000000..25d55df63bd3 --- /dev/null +++ b/lld/test/ELF/reproduce-win32.s @@ -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 diff --git a/lld/test/lit.cfg b/lld/test/lit.cfg index 5a994e130456..a8943bd0d303 100644 --- a/lld/test/lit.cfg +++ b/lld/test/lit.cfg @@ -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')