brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · c65f116 Raw
41 lines · plain
1// REQUIRES: x862 3// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o4// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \5// RUN:   %p/Inputs/whole-archive.s -o %ta.o6// RUN: rm -f %t.a7// RUN: llvm-ar rcs %t.a %ta.o8 9// Should not add symbols from the archive by default as they are not required10// RUN: ld.lld -o %t3 %t.o %t.a11// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=NOTADDED %s12// NOTADDED: Symbols [13// NOTADDED-NOT: Name: _bar14// NOTADDED: ]15 16// Should add symbols from the archive if --whole-archive is used17// RUN: ld.lld -o %t3 %t.o --whole-archive %t.a18// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=ADDED %s19// ADDED: Symbols [20// ADDED: Name: _bar21// ADDED: ]22 23// --no-whole-archive should restore default behaviour24// RUN: ld.lld -o %t3 %t.o --whole-archive --no-whole-archive %t.a25// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=NOTADDED %s26 27// --whole-archive and --no-whole-archive should affect only archives which follow them28// RUN: ld.lld -o %t3 %t.o %t.a --whole-archive --no-whole-archive29// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=NOTADDED %s30// RUN: ld.lld -o %t3 %t.o --whole-archive %t.a --no-whole-archive31// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=ADDED %s32 33// --whole-archive should also work with thin archives34// RUN: rm -f %tthin.a35// RUN: llvm-ar --format=gnu rcsT %tthin.a %ta.o36// RUN: ld.lld -o %t3 %t.o --whole-archive %tthin.a37// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=ADDED %s38 39.globl _start40_start:41