2017-01-06 10:33:53 +08:00
|
|
|
# REQUIRES: x86
|
2016-04-26 08:22:24 +08:00
|
|
|
|
2017-01-06 10:33:53 +08:00
|
|
|
# Extracting the tar archive can get over the path limit on windows.
|
2016-05-03 09:25:28 +08:00
|
|
|
# REQUIRES: shell
|
2016-05-03 08:36:15 +08:00
|
|
|
|
2016-04-27 04:36:46 +08:00
|
|
|
# RUN: rm -rf %t.dir
|
|
|
|
# RUN: mkdir -p %t.dir/build1
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.dir/build1/foo.o
|
|
|
|
# RUN: cd %t.dir
|
2017-01-06 10:33:53 +08:00
|
|
|
# RUN: ld.lld --hash-style=gnu build1/foo.o -o bar -shared --as-needed --reproduce repro.tar
|
|
|
|
# RUN: tar xf repro.tar
|
2016-05-01 05:40:04 +08:00
|
|
|
# RUN: diff build1/foo.o repro/%:t.dir/build1/foo.o
|
2016-04-27 04:36:46 +08:00
|
|
|
|
2016-05-01 05:40:04 +08:00
|
|
|
# RUN: FileCheck %s --check-prefix=RSP < repro/response.txt
|
2016-05-02 21:00:42 +08:00
|
|
|
# RSP: {{^}}--hash-style gnu{{$}}
|
2016-05-03 02:16:14 +08:00
|
|
|
# RSP-NOT: repro{{[/\\]}}
|
|
|
|
# RSP-NEXT: {{[/\\]}}foo.o
|
2016-05-01 05:40:04 +08:00
|
|
|
# RSP-NEXT: -o bar
|
|
|
|
# RSP-NEXT: -shared
|
|
|
|
# RSP-NEXT: --as-needed
|
2016-04-27 04:36:46 +08:00
|
|
|
|
2016-06-06 23:34:37 +08:00
|
|
|
# RUN: FileCheck %s --check-prefix=VERSION < repro/version.txt
|
|
|
|
# VERSION: LLD
|
|
|
|
|
2016-04-27 04:36:46 +08:00
|
|
|
# RUN: mkdir -p %t.dir/build2/a/b/c
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.dir/build2/foo.o
|
|
|
|
# RUN: cd %t.dir/build2/a/b/c
|
2017-01-06 10:33:53 +08:00
|
|
|
# RUN: env LLD_REPRODUCE=repro.tar ld.lld ./../../../foo.o -o bar -shared --as-needed
|
|
|
|
# RUN: tar xf repro.tar
|
2016-05-01 05:40:04 +08:00
|
|
|
# RUN: diff %t.dir/build2/foo.o repro/%:t.dir/build2/foo.o
|
|
|
|
|
2016-05-03 22:29:42 +08:00
|
|
|
# RUN: echo "{ local: *; };" > ver
|
2016-12-09 01:54:26 +08:00
|
|
|
# RUN: echo "{};" > dyn
|
2016-05-03 22:29:42 +08:00
|
|
|
# RUN: echo > file
|
2016-06-01 14:17:27 +08:00
|
|
|
# RUN: echo > file2
|
2016-05-03 22:29:42 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o 'foo bar'
|
2017-01-06 10:33:53 +08:00
|
|
|
# RUN: ld.lld --reproduce repro2.tar 'foo bar' -L"foo bar" -Lfile -Tfile2 \
|
2016-11-23 06:54:03 +08:00
|
|
|
# RUN: --dynamic-list dyn -rpath file --script=file --version-script ver \
|
2016-05-05 07:12:55 +08:00
|
|
|
# RUN: --dynamic-linker "some unusual/path" -soname 'foo bar' -soname='foo bar'
|
2017-01-06 10:33:53 +08:00
|
|
|
# RUN: tar xf repro2.tar
|
2016-05-01 05:40:04 +08:00
|
|
|
# RUN: FileCheck %s --check-prefix=RSP2 < repro2/response.txt
|
2016-05-03 22:29:42 +08:00
|
|
|
# RSP2: "{{.*}}foo bar"
|
|
|
|
# RSP2-NEXT: -L "{{.*}}foo bar"
|
2016-05-01 06:46:47 +08:00
|
|
|
# RSP2-NEXT: -L {{.+}}file
|
2016-06-01 14:17:27 +08:00
|
|
|
# RSP2-NEXT: --script {{.+}}file2
|
2016-05-03 22:29:42 +08:00
|
|
|
# RSP2-NEXT: --dynamic-list {{.+}}dyn
|
2016-05-03 02:12:09 +08:00
|
|
|
# RSP2-NEXT: -rpath {{.+}}file
|
|
|
|
# RSP2-NEXT: --script {{.+}}file
|
2016-06-05 21:19:39 +08:00
|
|
|
# RSP2-NEXT: --version-script [[PATH:.*]]ver
|
2016-05-03 01:34:17 +08:00
|
|
|
# RSP2-NEXT: --dynamic-linker "some unusual/path"
|
2016-05-05 07:12:55 +08:00
|
|
|
# RSP2-NEXT: -soname="foo bar"
|
|
|
|
# RSP2-NEXT: -soname="foo bar"
|
2016-04-27 04:36:46 +08:00
|
|
|
|
2017-01-06 10:33:53 +08:00
|
|
|
# RUN: tar tf repro2.tar | FileCheck %s
|
2016-06-05 21:19:39 +08:00
|
|
|
# CHECK: repro2/response.txt
|
2016-06-06 23:34:37 +08:00
|
|
|
# CHECK-NEXT: repro2/version.txt
|
2016-06-05 21:19:39 +08:00
|
|
|
# CHECK-NEXT: repro2/{{.*}}/dyn
|
|
|
|
# CHECK-NEXT: repro2/{{.*}}/ver
|
|
|
|
# CHECK-NEXT: repro2/{{.*}}/foo bar
|
|
|
|
# CHECK-NEXT: repro2/{{.*}}/file2
|
|
|
|
# CHECK-NEXT: repro2/{{.*}}/file
|
|
|
|
|
2017-02-02 02:04:45 +08:00
|
|
|
## Check that directory path is stripped from -o <file-path>
|
|
|
|
# RUN: mkdir -p %t.dir/build3/a/b/c
|
|
|
|
# RUN: cd %t.dir
|
|
|
|
# RUN: ld.lld build1/foo.o -o build3/a/b/c/bar -shared --as-needed --reproduce repro3.tar
|
|
|
|
# RUN: tar xf repro3.tar
|
|
|
|
# RUN: FileCheck %s --check-prefix=RSP3 < repro3/response.txt
|
|
|
|
# RSP3: -o bar
|
|
|
|
|
2016-04-27 03:04:35 +08:00
|
|
|
.globl _start
|
2016-04-26 08:22:24 +08:00
|
|
|
_start:
|
|
|
|
mov $60, %rax
|
|
|
|
mov $42, %rdi
|
|
|
|
syscall
|