1# REQUIRES: x86 2# RUN: llvm-mc %s -filetype=obj -triple=x86_64-windows-msvc -o %t.obj 3# RUN: lld-link %t.obj -export:foo -export:bar -dll -noentry -out:%t.dll -merge:.xdata=.xdata -verbose 2>&1 | FileCheck %s 4# RUN: llvm-readobj --sections %t.dll | FileCheck %s --check-prefix=XDATA 5 6# Test xdata can be merged when text and pdata differ. This test is structured 7# so that xdata comes after pdata, which makes xdata come before pdata in the 8# assocChildren linked list. 9 10# CHECK: ICF needed {{.*}} iterations 11# CHECK: Selected 12# CHECK: Removed 13 14# XDATA: Name: .xdata 15# XDATA-NEXT: VirtualSize: 0x4 16 17 .section .text,"xr",discard,foo 18 .globl foo 19foo: 20 pushq %rax 21 popq %rax 22 retq 23 24.section .pdata,"r",associative,foo 25.long foo 26.long 5 27.long foo_xdata@IMGREL 28 29 30.section .xdata,"r",associative,foo 31foo_xdata: 32.long 42 33 34 .section .text,"xr",discard,bar 35 .globl bar 36bar: 37 pushq %rcx 38 popq %rcx 39 retq 40 41.section .pdata,"r",associative,bar 42.long bar 43.long 5 44.long bar_xdata@IMGREL 45 46.section .xdata,"r",associative,bar 47bar_xdata: 48.long 42 49