Files
clang-p2996/llvm/test/ExecutionEngine/JITLink/X86/COFF_comdat_weak.s
Sunho Kim b501770aef [JITLink][COFF] Handle COMDAT symbol with offset.
Handles COMDAT symbol with an offset and refactor the code to only generated symbol if the second symbol was encountered. This happens very infrequently but happens in recursive_mutex implementation of MSVC STL library.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D130454
2022-07-31 09:09:48 +09:00

32 lines
656 B
ArmAsm

# REQUIRES: asserts
# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t
# RUN: llvm-jitlink --debug-only=jitlink -noexec %t 2>&1 | FileCheck %s
#
# Check a COMDAT any symbol is exported as a weak symbol.
#
# CHECK: Creating graph symbols...
# CHECK: 8: Exporting COMDAT graph symbol for COFF symbol "func" in section 4
# CHECK-NEXT: 0x0 (block + 0x00000000): size: 0x00000000, linkage: weak, scope: default, dead - func
.text
.def func;
.scl 2;
.type 32;
.endef
.section .text,"xr",discard,func
.globl func
.p2align 4, 0x90
func:
retq
.def main;
.scl 2;
.type 32;
.endef
.text
.globl main
.p2align 4, 0x90
main:
retq