Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / strtab-nodedup.s
blobb20e738de06796880376950b324bba9652fa2c74
1 # REQUIRES: x86
2 # RUN: split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/a.s -o %t/a.o
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/b.s -o %t/b.o
6 ## Non-empty local symbol names are not deduplicated. This helps parallel
7 ## .symtab write. We used to perform deduplication at -O2.
8 # RUN: ld.lld %t/a.o %t/b.o -o %t/a
9 # RUN: llvm-readelf -p .strtab %t/a | FileCheck %s --check-prefix=NODEDUP
10 # RUN: ld.lld -r -O2 %t/a.o %t/b.o -o %t/a.ro
11 # RUN: llvm-readelf -p .strtab %t/a.ro | FileCheck %s --check-prefix=NODEDUP
13 # NODEDUP: [ 1] local
14 # NODEDUP-NEXT: [ 7] local
15 # NODEDUP-NEXT: [ d] foo
16 # NODEDUP-EMPTY:
18 # RUN: llvm-readelf -s %t/a.ro | FileCheck %s --check-prefix=SYMTAB
20 # SYMTAB: 0: {{0+}} 0 NOTYPE LOCAL DEFAULT UND
21 # SYMTAB-NEXT: NOTYPE LOCAL DEFAULT [[#]] local
22 # SYMTAB-NEXT: SECTION LOCAL DEFAULT [[#]] .text
23 # SYMTAB-NEXT: NOTYPE LOCAL DEFAULT [[#]] local
24 # SYMTAB-NEXT: NOTYPE GLOBAL DEFAULT [[#]] foo
26 #--- a.s
27 .global foo
28 foo:
29 local:
30 ret
32 #--- b.s
33 .weak foo
34 foo:
35 local:
36 ret