[lld] r267588 - Make test/ELF/reproduces.s test to work on Windows.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 12:04:36 PDT 2016


Author: ruiu
Date: Tue Apr 26 14:04:35 2016
New Revision: 267588

URL: http://llvm.org/viewvc/llvm-project?rev=267588&view=rev
Log:
Make test/ELF/reproduces.s test to work on Windows.

Previously, the test didn't work on Windows because it tried to
concatenate two (possibly) absolute paths. If two paths are absolute
paths that have drive letters, then the result would become something
like C:\foo\D:\bar. That's not a valid path. I changed the test to
use relative paths.

Modified:
    lld/trunk/test/ELF/reproduce.s

Modified: lld/trunk/test/ELF/reproduce.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/reproduce.s?rev=267588&r1=267587&r2=267588&view=diff
==============================================================================
--- lld/trunk/test/ELF/reproduce.s (original)
+++ lld/trunk/test/ELF/reproduce.s Tue Apr 26 14:04:35 2016
@@ -1,26 +1,21 @@
-# REQUIRES: x86, shell
+# REQUIRES: x86
 
-# RUN: rm -rf %t.dir/repro
-# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-# RUN: ld.lld %t -o %t2 -shared --as-needed --reproduce %t.dir/repro
-# RUN: llvm-objdump -d %t.dir/repro/%t | FileCheck %s --check-prefix=DUMP
-# RUN: cat %t.dir/repro/invocation.txt | FileCheck %s --check-prefix=INVOCATION
+# RUN: rm -rf %t.dir1
+# RUN: mkdir -p %t.dir1/build
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.dir1/build/foo.o
+# RUN: cd %t.dir1
+# RUN: ld.lld build/foo.o -o bar -shared --as-needed --reproduce repro
+# RUN: diff build/foo.o repro/build/foo.o
 
-.globl _start;
+.globl _start
 _start:
   mov $60, %rax
   mov $42, %rdi
   syscall
 
-# DUMP: Disassembly of section .text:
-# DUMP: _start:
-# DUMP:        0:       48 c7 c0 3c 00 00 00    movq    $60, %rax
-# DUMP:        7:       48 c7 c7 2a 00 00 00    movq    $42, %rdi
-# DUMP:        e:       0f 05   syscall
+# RUN: FileCheck %s --check-prefix=INVOCATION < repro/invocation.txt
+# INVOCATION: lld{{[^\s]*}} build/foo.o -o bar -shared --as-needed --reproduce repro
 
-# INVOCATION: lld {{.*}}reproduce.s{{.*}} -o {{.*}} -shared --as-needed --reproduce
-
-# RUN: rm -rf %t.dir/repro2
-# RUN: mkdir %t.dir/repro2
-# RUN: not ld.lld %t -o %t2 --reproduce %t.dir/repro2 2>&1 | FileCheck --check-prefix=EDIR %s
-# EDIR: --reproduce: can't create directory
+# RUN: not ld.lld build/foo.o -o bar -shared --as-needed --reproduce repro 2>&1 \
+# RUN:   | FileCheck --check-prefix=ERROR %s
+# ERROR: --reproduce: can't create directory




More information about the llvm-commits mailing list