71 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t; split-file %s %t3 4# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/live.s -o %t/live.o5# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/dead.s -o %t/dead.o6 7# RUN: not %lld -undefined bogus -o /dev/null %t/live.o 2>&1 | \8# RUN: FileCheck %s -check-prefix=UNKNOWN9# RUN: not %lld -undefined error -o /dev/null %t/live.o 2>&1 | \10# RUN: FileCheck %s -check-prefix=ERROR11 12# RUN: not %lld -undefined warning -o /dev/null %t/live.o 2>&1 | \13# RUN: FileCheck %s -check-prefix=INVAL-WARNING14# RUN: not %lld -undefined suppress -o /dev/null %t/live.o 2>&1 | \15# RUN: FileCheck %s -check-prefix=INVAL-SUPPRESS16# RUN: %lld -undefined dynamic_lookup -lSystem -o %t/live.out %t/live.o 2>&1 | count 017# RUN: llvm-objdump --macho --lazy-bind %t/live.out \18# RUN: | FileCheck --check-prefix=BIND %s19 20# RUN: %no-fatal-warnings-lld -lSystem -flat_namespace -undefined warning \21# RUN: -o %t/live.out %t/live.o 2>&1 | \22# RUN: FileCheck %s -check-prefix=WARNING23# RUN: llvm-objdump --macho --lazy-bind %t/live.out \24# RUN: | FileCheck --check-prefix=BIND %s25# RUN: %lld -flat_namespace -lSystem -undefined suppress -o %t/live.out %t/live.o \26# RUN: 2>&1 | count 027# RUN: llvm-objdump --macho --lazy-bind %t/live.out \28# RUN: | FileCheck --check-prefix=BIND %s29# RUN: %lld -flat_namespace -lSystem -undefined dynamic_lookup -o \30# RUN: %t/live.out %t/live.o 2>&1 | count 031# RUN: llvm-objdump --macho --lazy-bind %t/live.out \32# RUN: | FileCheck --check-prefix=BIND %s33 34## Undefined symbols in dead code should not raise an error iff35## -dead_strip is enabled.36# RUN: not %lld -dylib -undefined error -o /dev/null %t/dead.o 2>&1 \37# RUN: | FileCheck --check-prefix=ERROR %s38# RUN: not %lld -dylib -dead_strip -undefined error -o /dev/null %t/live.o 2>&1\39# RUN: | FileCheck --check-prefix=ERROR %s40# RUN: %lld -dylib -dead_strip -undefined error -o /dev/null %t/dead.o41 42# ERROR: error: undefined symbol: _bar43# ERROR-NEXT: >>> referenced by44 45# INVAL-WARNING: error: '-undefined warning' only valid with '-flat_namespace'46# INVAL-WARNING-NOT: error: undefined symbol: _bar47 48# INVAL-SUPPRESS: error: '-undefined suppress' only valid with '-flat_namespace'49# INVAL-SUPPRESS-NOT: error: undefined symbol: _bar50 51# WARNING: warning: undefined symbol: _bar52# WARNING-NEXT: >>> referenced by53 54# UNKNOWN: unknown -undefined TREATMENT 'bogus'55# UNKNOWN-NEXT: error: undefined symbol: _bar56# UNKNOWN-NEXT: >>> referenced by57 58# BIND: Lazy bind table:59# BIND: __DATA __la_symbol_ptr 0x{{[0-9a-f]*}} flat-namespace _bar60 61#--- live.s62.globl _main63_main:64 callq _bar65 ret66 67#--- dead.s68_dead:69 callq _bar70 ret71