llvm-project/lld/test/ELF/comdat-local-signature.s
Fangrui Song 928a197d26 [ELF] Add a GRP_COMDAT test with a local signature symbol
See https://groups.google.com/g/generic-abi/c/2X6mR-s2zoc

Test that a local signature symbol does not suppress COMDAT deduplication.
2021-06-08 09:22:30 -07:00

31 lines
900 B
ArmAsm

# REQUIRES: x86
## COMDAT groups are deduplicated by the name of the signature symbol.
## The local/global status is not part of the equation.
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
# RUN: ld.lld %t.o %t.o -o %t
# RUN: llvm-readelf -s -x .zero -x .comdat %t | FileCheck %s
# CHECK: Type Bind Vis Ndx Name
# CHECK-NEXT: NOTYPE LOCAL DEFAULT UND
# CHECK-NEXT: NOTYPE LOCAL DEFAULT [[#A:]] zero
# CHECK-NEXT: NOTYPE LOCAL DEFAULT [[#]] comdat
# CHECK-NEXT: NOTYPE LOCAL DEFAULT [[#A]] zero
# CHECK-NOT: {{.}}
## Non-GRP_COMDAT groups are never deduplicated.
# CHECK: Hex dump of section '.zero':
# CHECK-NEXT: [[#%x,]] 0202
## GRP_COMDAT groups are deduplicated.
# CHECK: Hex dump of section '.comdat':
# CHECK-NEXT: [[#%x,]] 01 .{{$}}
.section .zero,"aG",@progbits,zero
zero:
.byte 2
.section .comdat,"aG",@progbits,comdat,comdat
comdat:
.byte 1