1# REQUIRES: x86 2# RUN: rm -rf %t; split-file %s %t 3 4# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/test.s -o %t/test.o 5 6## Check that we correctly dedup sections that reference dynamic-lookup symbols. 7# RUN: %lld -lSystem -dylib --icf=all -undefined dynamic_lookup -o %t/test %t/test.o 8# RUN: llvm-objdump --macho --syms %t/test | FileCheck %s 9 10## Check that we still raise an error when using regular undefined symbol 11## treatment. 12# RUN: not %lld -lSystem -dylib --icf=all -o /dev/null %t/test.o 2>&1 | \ 13# RUN: FileCheck %s --check-prefix=ERR 14 15# CHECK: [[#%x,ADDR:]] l F __TEXT,__text _foo 16# CHECK: [[#ADDR]] l F __TEXT,__text _bar 17 18# ERR: error: undefined symbol: _undef 19 20#--- test.s 21 22.subsections_via_symbols 23 24_foo: 25 callq _undef + 1 26 27_bar: 28 callq _undef + 1 29