1# REQUIRES: x86 2 3# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o 4# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \ 5# RUN: %p/Inputs/allow-shlib-undefined.s -o %t1.o 6# RUN: ld.lld -shared %t1.o -o %t.so 7 8# RUN: ld.lld --allow-shlib-undefined %t.o %t.so -o /dev/null 9# RUN: not ld.lld --no-allow-shlib-undefined %t.o %t.so -o /dev/null 2>&1 | FileCheck %s 10# Executable defaults to --no-allow-shlib-undefined 11# RUN: not ld.lld %t.o %t.so -o /dev/null 2>&1 | FileCheck %s 12# RUN: ld.lld %t.o %t.so --noinhibit-exec -o /dev/null 2>&1 | FileCheck %s --check-prefix=WARN 13# RUN: ld.lld %t.o %t.so --warn-unresolved-symbols -o /dev/null 2>&1 | FileCheck %s --check-prefix=WARN 14# -shared defaults to --allow-shlib-undefined 15# RUN: ld.lld -shared %t.o %t.so -o /dev/null 16 17# RUN: echo | llvm-mc -filetype=obj -triple=x86_64-unknown-linux -o %tempty.o 18# RUN: ld.lld -shared %tempty.o -o %tempty.so 19# RUN: ld.lld -shared %t1.o %tempty.so -o %t2.so 20# RUN: ld.lld --no-allow-shlib-undefined %t.o %t2.so -o /dev/null 21 22# DSO with undefines: 23# should link with or without any of these options. 24# RUN: ld.lld -shared %t1.o -o /dev/null 25# RUN: ld.lld -shared --allow-shlib-undefined %t1.o -o /dev/null 26# RUN: ld.lld -shared --no-allow-shlib-undefined %t1.o -o /dev/null 27 28.globl _start 29_start: 30 callq _shared@PLT 31 32# CHECK: error: {{.*}}.so: undefined reference to _unresolved [--no-allow-shlib-undefined] 33# WARN: warning: {{.*}}.so: undefined reference to _unresolved [--no-allow-shlib-undefined] 34