brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 6477d9d Raw
40 lines · plain
1// REQUIRES: x862 3// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o4// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \5// RUN:   %p/Inputs/whole-archive.s -o %t2.o6// RUN: rm -f %t.a7// RUN: llvm-ar rcs %t.a %t2.o8 9// RUN: ld.lld -o %t.exe -push-state -whole-archive %t.a %t1.o -M | \10// RUN:   FileCheck -check-prefix=WHOLE %s11// WHOLE: _bar12 13// RUN: ld.lld -o %t.exe -push-state -whole-archive -pop-state %t.a %t1.o -M | \14// RUN:   FileCheck -check-prefix=NO-WHOLE %s15// NO-WHOLE-NOT: _bar16 17 18// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/shared.s -o %t3.o19// RUN: ld.lld -shared %t3.o -soname libfoo -o %t.so20 21// RUN: ld.lld -o %t.exe -push-state -as-needed %t.so %t1.o22// RUN: llvm-readobj --dynamic-table %t.exe | FileCheck -check-prefix=AS-NEEDED %s23// AS-NEEDED-NOT: NEEDED Shared library: [libfoo]24 25// RUN: ld.lld -o %t.exe -push-state -as-needed -pop-state %t.so %t1.o26// RUN: llvm-readobj --dynamic-table %t.exe | FileCheck -check-prefix=NO-AS-NEEDED %s27// NO-AS-NEEDED: NEEDED Shared library: [libfoo]28 29 30// RUN: mkdir -p %t.dir31// RUN: cp %t.so %t.dir/libfoo.so32// RUN: ld.lld -o %t.exe -L%t.dir -push-state -static -pop-state  %t1.o -lfoo33// RUN: not ld.lld -o /dev/null -L%t.dir -push-state -static %t1.o -lfoo34 35// RUN: not ld.lld -o /dev/null -pop-state %t.a %t1.o -M 2>&1 | FileCheck -check-prefix=ERR %s36// ERR: error: unbalanced --push-state/--pop-state37 38.globl _start39_start:40