2016-04-27 03:04:35 +08:00
|
|
|
# REQUIRES: x86
|
2016-04-26 08:22:24 +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
|
2016-05-02 21:00:42 +08:00
|
|
|
# RUN: ld.lld --hash-style=gnu build1/foo.o -o bar -shared --as-needed --reproduce repro
|
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-02 22:12:35 +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
|
|
|
|
|
|
|
# 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
|
|
|
|
# RUN: ld.lld ./../../../foo.o -o bar -shared --as-needed --reproduce repro
|
2016-05-01 05:40:04 +08:00
|
|
|
# RUN: diff %t.dir/build2/foo.o repro/%:t.dir/build2/foo.o
|
|
|
|
|
2016-05-01 06:46:47 +08:00
|
|
|
# RUN: touch file
|
2016-05-03 01:34:17 +08:00
|
|
|
# RUN: not ld.lld --reproduce repro2 'foo bar' -L"foo bar" -Lfile -version-script file \
|
|
|
|
# RUN: --dynamic-linker "some unusual/path"
|
2016-05-01 05:40:04 +08:00
|
|
|
# RUN: FileCheck %s --check-prefix=RSP2 < repro2/response.txt
|
|
|
|
# RSP2: "foo bar"
|
2016-05-01 06:46:47 +08:00
|
|
|
# RSP2-NEXT: -L "foo bar"
|
|
|
|
# RSP2-NEXT: -L {{.+}}file
|
|
|
|
# RSP2-NEXT: -version-script {{.+}}file
|
2016-05-03 01:34:17 +08:00
|
|
|
# RSP2-NEXT: --dynamic-linker "some unusual/path"
|
2016-04-27 04:36:46 +08:00
|
|
|
|
|
|
|
# RUN: not ld.lld build1/foo.o -o bar -shared --as-needed --reproduce . 2>&1 \
|
|
|
|
# RUN: | FileCheck --check-prefix=ERROR %s
|
|
|
|
# ERROR: can't create directory
|
2016-04-26 08:22:24 +08:00
|
|
|
|
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
|