Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / i386-linkonce.s
blob9e62421bab9e78a2cfb12ddd1c937b1ad533b8f0
1 # REQUIRES: x86
2 # RUN: rm -rf %t && split-file %s %t
3 # RUN: llvm-mc -filetype=obj -triple=i386 %t/a.s -o %t/a.o
4 # RUN: llvm-mc -filetype=obj -triple=i386 %t/crti.s -o %t/crti.o
5 # RUN: llvm-mc -filetype=obj -triple=i386 %t/elf-init.s -o %t/elf-init.o
7 ## crti.o in i386 glibc<2.32 has .gnu.linkonce.t.__x86.get_pc_thunk.bx that is
8 ## not fully supported. Test that we don't report
9 ## "relocation refers to a symbol in a discarded section: __x86.get_pc_thunk.bx".
10 # RUN: ld.lld %t/a.o %t/crti.o %t/elf-init.o -o /dev/null
11 # RUN: ld.lld -shared %t/a.o %t/crti.o %t/elf-init.o -o /dev/null
13 #--- a.s
14 .globl _start
15 _start:
17 #--- crti.s
18 .section .gnu.linkonce.t.__x86.get_pc_thunk.bx,"ax"
19 .globl __x86.get_pc_thunk.bx
20 .hidden __x86.get_pc_thunk.bx
21 __x86.get_pc_thunk.bx:
22 movl (%esp),%ebx
23 ret
25 #--- elf-init.s
26 .globl __libc_csu_init
27 __libc_csu_init:
28 call __x86.get_pc_thunk.bx
30 .section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
31 .globl __x86.get_pc_thunk.bx
32 .hidden __x86.get_pc_thunk.bx
33 __x86.get_pc_thunk.bx:
34 movl (%esp),%ebx
35 ret