brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 608b355 Raw
52 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o3 4## The link should fail with an undef error by default5# RUN: not ld.lld %t1.o -o /dev/null 2>&1 | \6# RUN: FileCheck -check-prefix=ERRUND %s7 8## --error-unresolved-symbols should generate an error9# RUN: not ld.lld %t1.o -o /dev/null --error-unresolved-symbols 2>&1 | \10# RUN: FileCheck -check-prefix=ERRUND %s11 12## --warn-unresolved-symbols should generate a warning13# RUN: ld.lld %t1.o -o %t5 --warn-unresolved-symbols 2>&1 | \14# RUN: FileCheck -check-prefix=WARNUND %s15 16## Test that the last option wins17# RUN: ld.lld %t1.o -o %t5 --error-unresolved-symbols --warn-unresolved-symbols 2>&1 | \18# RUN:  FileCheck -check-prefix=WARNUND %s19# RUN: not ld.lld %t1.o -o /dev/null --warn-unresolved-symbols --error-unresolved-symbols 2>&1 | \20# RUN:  FileCheck -check-prefix=ERRUND %s21 22## Do not report undefines if linking relocatable or shared.23## And while we're at it, check that we can accept single -24## variants of these options.25# RUN: ld.lld -r %t1.o -o /dev/null -error-unresolved-symbols 2>&1 | \26# RUN:  FileCheck -allow-empty -check-prefix=NOERR %s27# RUN: ld.lld -shared %t1.o -o /dev/null --error-unresolved-symbols 2>&1 | \28# RUN:  FileCheck -allow-empty -check-prefix=NOERR %s29# RUN: ld.lld -r %t1.o -o /dev/null -warn-unresolved-symbols 2>&1 | \30# RUN:  FileCheck -allow-empty -check-prefix=NOWARN %s31# RUN: ld.lld -shared %t1.o -o /dev/null --warn-unresolved-symbols 2>&1 | \32# RUN:  FileCheck -allow-empty -check-prefix=NOWARN %s33 34# ERRUND: error: undefined symbol: undef35# ERRUND: >>> referenced by {{.*}}:(.text+0x1)36 37# WARNUND: warning: undefined symbol: undef38# WARNUND: >>> referenced by {{.*}}:(.text+0x1)39 40# NOERR-NOT: error: undefined symbol: undef41# NOERR-NOT: >>> referenced by {{.*}}:(.text+0x1)42 43# NOWARN-NOT: warning: undefined symbol: undef44# NOWARN-NOT: >>> referenced by {{.*}}:(.text+0x1)45 46.globl _start47_start:48 49.globl _shared50_shared:51 callq undef@PLT52