1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3
4## Unresolved references from object files are allowed by default for -shared.
5# RUN: ld.lld -shared %t.o -o %t1.so
6
7## -z defs disallows unresolved references.
8# RUN: not ld.lld -z defs -shared %t.o -o /dev/null 2>&1 | FileCheck -check-prefix=ERR %s
9# ERR: error: undefined symbol: foo
10# ERR: >>> referenced by {{.*}}:(.text+0x1)
11
12## -z undefs allows unresolved references.
13# RUN: ld.lld -z defs -z undefs -shared %t.o -o /dev/null 2>&1 | count 0
14
15callq foo@PLT
16