2 ## For --gc-sections, group members are retained or discarded as a unit.
3 ## However, discarding a section via /DISCARD/ should not discard other members
4 ## within the group. This is compatible with GNU ld.
6 # RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o
8 ## We can discard .ARM.exidx* in a group.
9 # RUN: echo 'SECTIONS { /DISCARD/ : { *(.ARM.exidx*) }}' > %t.noarm.script
10 # RUN: ld.lld %t.o --gc-sections -T %t.noarm.script -o %t.noarm
11 # RUN: llvm-readobj -S %t.noarm | FileCheck %s --check-prefix=NOARM --implicit-check-not='Name: .ARM.exidx'
14 # NOARM: Name: .note._start
16 ## Another example, we can discard SHT_NOTE in a group.
17 # RUN: echo 'SECTIONS { /DISCARD/ : { *(.note*) }}' > %t.nonote.script
18 # RUN: ld.lld %t.o --gc-sections -T %t.nonote.script -o %t.nonote
19 # RUN: llvm-readobj -S %t.nonote | FileCheck %s --check-prefix=NONOTE --implicit-check-not='Name: .note'
21 # NONOTE: Name: .ARM.exidx
24 .section .text._start,"axG",%progbits,_start,comdat
32 .section .note._start,"G",%note,_start,comdat