annotate lld/test/ELF/whole-archive.s @ 192:d7606dcf6fce

Added tag llvm10 for changeset 0572611fdcc8
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 14 Dec 2020 18:01:34 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // REQUIRES: x86
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
anatofuz
parents:
diff changeset
4 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
anatofuz
parents:
diff changeset
5 // RUN: %p/Inputs/whole-archive.s -o %ta.o
anatofuz
parents:
diff changeset
6 // RUN: rm -f %t.a
anatofuz
parents:
diff changeset
7 // RUN: llvm-ar rcs %t.a %ta.o
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 // Should not add symbols from the archive by default as they are not required
anatofuz
parents:
diff changeset
10 // RUN: ld.lld -o %t3 %t.o %t.a
anatofuz
parents:
diff changeset
11 // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=NOTADDED %s
anatofuz
parents:
diff changeset
12 // NOTADDED: Symbols [
anatofuz
parents:
diff changeset
13 // NOTADDED-NOT: Name: _bar
anatofuz
parents:
diff changeset
14 // NOTADDED: ]
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 // Should add symbols from the archive if --whole-archive is used
anatofuz
parents:
diff changeset
17 // RUN: ld.lld -o %t3 %t.o --whole-archive %t.a
anatofuz
parents:
diff changeset
18 // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=ADDED %s
anatofuz
parents:
diff changeset
19 // ADDED: Symbols [
anatofuz
parents:
diff changeset
20 // ADDED: Name: _bar
anatofuz
parents:
diff changeset
21 // ADDED: ]
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 // --no-whole-archive should restore default behaviour
anatofuz
parents:
diff changeset
24 // RUN: ld.lld -o %t3 %t.o --whole-archive --no-whole-archive %t.a
anatofuz
parents:
diff changeset
25 // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=NOTADDED %s
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 // --whole-archive and --no-whole-archive should affect only archives which follow them
anatofuz
parents:
diff changeset
28 // RUN: ld.lld -o %t3 %t.o %t.a --whole-archive --no-whole-archive
anatofuz
parents:
diff changeset
29 // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=NOTADDED %s
anatofuz
parents:
diff changeset
30 // RUN: ld.lld -o %t3 %t.o --whole-archive %t.a --no-whole-archive
anatofuz
parents:
diff changeset
31 // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=ADDED %s
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 // --whole-archive should also work with thin archives
anatofuz
parents:
diff changeset
34 // RUN: rm -f %tthin.a
anatofuz
parents:
diff changeset
35 // RUN: llvm-ar --format=gnu rcsT %tthin.a %ta.o
anatofuz
parents:
diff changeset
36 // RUN: ld.lld -o %t3 %t.o --whole-archive %tthin.a
anatofuz
parents:
diff changeset
37 // RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=ADDED %s
anatofuz
parents:
diff changeset
38
anatofuz
parents:
diff changeset
39 .globl _start
anatofuz
parents:
diff changeset
40 _start: