[Clang] replace 'bitfield' with 'bit-field' for consistency (#117881)
[llvm-project.git] / lld / test / ELF / reproduce.s
blob29dc109d5a4126da6a60ec81fae5c16fbfa21308
1 # REQUIRES: x86
3 # RUN: rm -rf %t.dir
4 # RUN: mkdir -p %t.dir/build1
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.dir/build1/foo.o
6 # RUN: cd %t.dir
7 # RUN: ld.lld --hash-style=gnu build1/foo.o -o bar -shared --as-needed --reproduce repro1.tar
8 # RUN: tar xOf repro1.tar repro1/%:t.dir/build1/foo.o > build1-foo.o
9 # RUN: cmp build1/foo.o build1-foo.o
11 # RUN: tar xf repro1.tar repro1/response.txt repro1/version.txt
12 # RUN: FileCheck %s --check-prefix=RSP1 < repro1/response.txt
13 # RSP1: {{^}}--hash-style gnu{{$}}
14 # RSP1-NOT: {{^}}repro1{{[/\\]}}
15 # RSP1-NEXT: {{[/\\]}}foo.o
16 # RSP1-NEXT: -o bar
17 # RSP1-NEXT: -shared
18 # RSP1-NEXT: --as-needed
20 # RUN: FileCheck %s --check-prefix=VERSION < repro1/version.txt
21 # VERSION: LLD
23 # RUN: mkdir -p %t.dir/build2/a/b/c
24 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.dir/build2/foo.o
25 # RUN: cd %t.dir/build2/a/b/c
26 # RUN: env LLD_REPRODUCE=repro2.tar ld.lld ./../../../foo.o -o /dev/null -shared --as-needed
27 # RUN: tar xOf repro2.tar repro2/%:t.dir/build2/foo.o > build2-foo.o
28 # RUN: cmp %t.dir/build2/foo.o build2-foo.o
30 # RUN: mkdir -p %t.dir/build3
31 # RUN: cd %t.dir/build3
32 # RUN: echo "{ local: *; };" > ver
33 # RUN: echo "{};" > dyn
34 # RUN: cp dyn dyn2
35 # RUN: echo > file
36 # RUN: echo > file2
37 # RUN: echo > file3
38 # RUN: echo "_start" > order
39 # RUN: mkdir "sysroot with spaces"
40 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o 'foo bar'
41 # RUN: ld.lld --reproduce repro3.tar 'foo bar' -L"foo bar" -Lfile -Tfile2 -dT file3 \
42 # RUN: --dynamic-list dyn --export-dynamic-symbol-list dyn2 -rpath file --script=file --symbol-ordering-file order \
43 # RUN: --sysroot "sysroot with spaces" --sysroot="sysroot with spaces" \
44 # RUN: --version-script ver --dynamic-linker "some unusual/path" -soname 'foo bar' \
45 # RUN: -soname='foo bar'
46 # RUN: tar xOf repro3.tar repro3/response.txt | FileCheck %s --check-prefix=RSP3
47 # RSP3: --chroot .
48 # RSP3: "{{.*}}foo bar"
49 # RSP3-NEXT: -L "[[BASEDIR:.+]]/foo bar"
50 # RSP3-NEXT: -L [[BASEDIR]]/file
51 # RSP3-NEXT: --script [[BASEDIR]]/file2
52 # RSP3-NEXT: --default-script [[BASEDIR]]/file3
53 # RSP3-NEXT: --dynamic-list [[BASEDIR]]/dyn
54 # RSP3-NEXT: --export-dynamic-symbol-list [[BASEDIR]]/dyn2
55 # RSP3-NEXT: -rpath [[BASEDIR]]/file
56 # RSP3-NEXT: --script [[BASEDIR]]/file
57 # RSP3-NEXT: --symbol-ordering-file [[BASEDIR]]/order
58 # RSP3-NEXT: --sysroot "[[BASEDIR]]/sysroot with spaces"
59 # RSP3-NEXT: --sysroot "[[BASEDIR]]/sysroot with spaces"
60 # RSP3-NEXT: --version-script [[BASEDIR]]/ver
61 # RSP3-NEXT: --dynamic-linker "some unusual/path"
62 # RSP3-NEXT: -soname "foo bar"
63 # RSP3-NEXT: -soname "foo bar"
65 # RUN: tar tf repro3.tar | FileCheck %s
66 # CHECK: repro3/response.txt
67 # CHECK-NEXT: repro3/version.txt
68 # CHECK-NEXT: repro3/{{.*}}/order
69 # CHECK-NEXT: repro3/{{.*}}/dyn
70 # CHECK-NEXT: repro3/{{.*}}/dyn2
71 # CHECK-NEXT: repro3/{{.*}}/ver
72 # CHECK-NEXT: repro3/{{.*}}/foo bar
73 # CHECK-NEXT: repro3/{{.*}}/file2
74 # CHECK-NEXT: repro3/{{.*}}/file
76 ## Check that directory path is stripped from -o <file-path>
77 # RUN: mkdir -p %t.dir/build4/a/b/c
78 # RUN: cd %t.dir
79 # RUN: ld.lld build1/foo.o -o build4/a/b/c/bar -Map build4/map --dependency-file=build4/bar.d --print-archive-stats=build4/stats \
80 # RUN: --why-extract=build4/why -shared --as-needed --reproduce=repro4.tar
81 # RUN: tar xOf repro4.tar repro4/response.txt | FileCheck %s --check-prefix=RSP4
82 # RSP4: -o bar
83 # RSP4-NEXT: -Map map
84 # RSP4-NEXT: --dependency-file bar.d
85 # RSP4-NEXT: --print-archive-stats=stats
86 # RSP4-NEXT: --why-extract=why
88 .globl _start
89 _start:
90 mov $60, %rax
91 mov $42, %rdi
92 syscall