brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 1be01c7 Raw
86 lines · plain
1# REQUIRES: x862## --remap-inputs and --remap-inputs-file= remap input files.3 4# RUN: rm -rf %t && split-file %s %t && cd %t5# RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o6# RUN: llvm-as b.ll -o b.o7# RUN: llvm-mc -filetype=obj -triple=x86_64 c.s -o c.o && llvm-ar rc c.a c.o8# RUN: llvm-mc -filetype=obj -triple=x86_64 d.s -o d.o && ld.lld -shared -soname=d d.o -o d.so9# RUN: ld.lld --remap-inputs-file=1.map --remap-inputs-file=2.map --remap-inputs='d*.so=d.so' --reproduce=repro.tar aa.o bb.bc cc.a dd.so empty -o out10# RUN: tar tf repro.tar | FileCheck %s --check-prefix=REPRO11 12# REPRO:      1.map13# REPRO-NEXT: 2.map14# REPRO-NEXT: a.o15# REPRO-NEXT: b.o16# REPRO-NEXT: c.a17# REPRO-NEXT: d.so18 19## --remap-inputs can also be specified multiple times.20# RUN: ld.lld --remap-inputs 'aa.o=a.o' --remap-inputs='d[d].so=d.so' aa.o b.o c.a d.so21 22## A multiple-to-one pattern may easily cause issues. Users should be careful.23# RUN: not ld.lld --remap-inputs-file=3.map aa.o bb.bc 2>&1 | \24# RUN:   FileCheck %s --check-prefix=DUPLICATE --implicit-check-not=error:25# DUPLICATE: error: duplicate symbol: _start26 27# RUN: not ld.lld --remap-inputs-file=err1.map aa.o bb.bc 2>&1 | \28# RUN:   FileCheck %s --check-prefix=ERR1 --implicit-check-not=error:29# ERR1:      error: err1.map:2: parse error, not 'from-glob=to-file'30# ERR1-NEXT: error: cannot open bb.bc: {{.*}}31 32# RUN: not ld.lld --remap-inputs-file=err2.map aa.o 2>&1 | \33# RUN:   FileCheck %s --check-prefix=ERR2 --implicit-check-not=error:34# ERR2:      error: err2.map:1: invalid glob pattern, unmatched '[': aa.[o35# ERR2-NEXT: error: cannot open aa.o: {{.*}}36 37# RUN: not ld.lld --remap-inputs=aa.o aa.o 2>&1 | \38# RUN:   FileCheck %s --check-prefix=ERR3 --implicit-check-not=error:39# RUN: not ld.lld --remap-inputs=aa.o= aa.o 2>&1 | \40# RUN:   FileCheck %s --check-prefix=ERR3 --implicit-check-not=error:41# ERR3:      error: --remap-inputs: parse error, not 'from-glob=to-file'42# ERR3-NEXT: error: cannot open aa.o: {{.*}}43 44#--- a.s45.globl _start46_start:47  call b48  call c49  call d50 51#--- b.ll52target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"53target triple = "x86_64-unknown-linux-gnu"54 55define void @b() {56  ret void57}58 59#--- c.s60.globl c61c:62 63#--- d.s64.globl d65d:66 67#--- 1.map68aa.o=a.o69b?.[b]c=b.o70 71#--- 2.map72cc.a=c.a73## Use /dev/null to indicate an input file which should be ignored.74empty=/dev/null75 76#--- 3.map77*=a.o78 79#--- err1.map80aa.o=a.o81bb.bc82cc.a83 84#--- err2.map85aa.[o=a.o86