[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / gc-sections-lsda.s
blob997e7c94f9b4e0135e80087f2cad453d2fbdf5c0
1 # REQUIRES: x86
2 # RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux
4 ## Discard an unused .gcc_except_table in a COMDAT group or having SHF_LINK_ORDER
5 ## if the associated text section is discarded.
7 # RUN: ld.lld --gc-sections --print-gc-sections -u _Z3foov %t.o -o /dev/null | \
8 # RUN: FileCheck %s --implicit-check-not=.gcc_except_table
10 # CHECK: removing unused section {{.*}}.o:(.text._Z6comdatv)
11 # CHECK-NEXT: removing unused section {{.*}}.o:(.text._Z9linkorderv)
12 # CHECK-NEXT: removing unused section {{.*}}.o:(.gcc_except_table._Z6comdatv)
13 # CHECK-NEXT: removing unused section {{.*}}.o:(.gcc_except_table._Z9linkorderv)
15 ## An unused non-group non-SHF_LINK_ORDER .gcc_except_table is not discarded.
17 # RUN: ld.lld --gc-sections --print-gc-sections -u _Z6comdatv -u _Z9linkorderv %t.o -o /dev/null | \
18 # RUN: FileCheck /dev/null --implicit-check-not=.gcc_except_table
20 ## If the text sections are live, the .gcc_except_table sections are retained as
21 ## well because they are referenced by .eh_frame pieces.
23 # RUN: ld.lld --gc-sections --print-gc-sections -u _Z3foov -u _Z6comdatv -u _Z9linkorderv %t.o -o /dev/null | \
24 # RUN: FileCheck %s --check-prefix=KEEP
26 # KEEP-NOT: .gcc_except_table
28 .section .text._Z3foov,"ax",@progbits
29 .globl _Z3foov
30 _Z3foov:
31 .cfi_startproc
32 ret
33 .cfi_lsda 0x1b,.Lexception0
34 .cfi_endproc
36 .section .text._Z6comdatv,"axG",@progbits,_Z6comdatv,comdat
37 .globl _Z6comdatv
38 _Z6comdatv:
39 .cfi_startproc
40 ret
41 .cfi_lsda 0x1b,.Lexception1
42 .cfi_endproc
44 .section .text._Z9linkorderv,"ax",@progbits
45 .globl _Z9linkorderv
46 _Z9linkorderv:
47 .cfi_startproc
48 ret
49 .cfi_lsda 0x1b,.Lexception2
50 .cfi_endproc
52 .section .gcc_except_table._Z3foov,"a",@progbits
53 .Lexception0:
54 .byte 255
56 .section .gcc_except_table._Z6comdatv,"aG",@progbits,_Z6comdatv,comdat
57 .Lexception1:
58 .byte 255
60 .section .gcc_except_table._Z9linkorderv,"ao",@progbits,_Z9linkorderv
61 .Lexception2:
62 .byte 255