1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3
4.section .foo,"a",@progbits,unique,1
5.byte 1
6
7.section .foo,"a",@progbits,unique,2
8.byte 2
9
10.section .foo,"a",@progbits,unique,3
11.byte 3
12
13## We should have 3 instances of orphan section foo.
14## Test with -r
15# RUN: ld.lld %t.o -o %t.elf --unique
16# RUN: llvm-readelf -S %t.elf | FileCheck %s
17
18# CHECK-COUNT-3: .foo
19# CHECK-NOT: .foo
20
21## Test that --unique does not affect sections specified in output section descriptions.
22# RUN: echo 'SECTIONS { .foo : { *(.foo) }}' > %t.script
23# RUN: ld.lld %t.o -o %t2.elf -T %t.script --unique
24# RUN: llvm-readelf -S %t2.elf | FileCheck --check-prefix SCRIPT %s
25# SCRIPT: .foo
26# SCRIPT-NOT: .foo
27