Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / icf-undef.s
blobef445fa5834559066f2eee635c4684292b748157
1 # REQUIRES: x86
2 # RUN: rm -rf %t; split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin19.0.0 %t/test.s -o %t/test.o
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
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
15 # CHECK: [[#%x,ADDR:]] l F __TEXT,__text _foo
16 # CHECK: [[#ADDR]] l F __TEXT,__text _bar
18 # ERR: error: undefined symbol: _undef
20 #--- test.s
22 .subsections_via_symbols
24 _foo:
25 callq _undef + 1
27 _bar:
28 callq _undef + 1