llvm-project
52 строки · 1.0 Кб
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 -verbose 2>&1 | FileCheck %s
4# RUN: llvm-readobj --sections %t.dll | FileCheck %s --check-prefix=TEXT
5
6# The order of the pdata and xdata sections here shouldn't matter. We should
7# still replace bar with foo.
8
9# CHECK: ICF needed {{.*}} iterations
10# CHECK: Selected foo
11# CHECK: Removed bar
12
13# We should only have five bytes of text.
14# TEXT: Name: .text
15# TEXT-NEXT: Size: 0x5
16
17.section .text,"xr",discard,foo
18.globl foo
19foo:
20pushq %rbx
21pushq %rdi
22popq %rdi
23popq %rbx
24retq
25
26
27.section .pdata,"r",associative,foo
28.long foo
29.long 5
30.long foo_xdata@IMGREL
31
32.section .xdata,"r",associative,foo
33foo_xdata:
34.long 42
35
36.section .text,"xr",discard,bar
37.globl bar
38bar:
39pushq %rbx
40pushq %rdi
41popq %rdi
42popq %rbx
43retq
44
45.section .xdata,"r",associative,bar
46bar_xdata:
47.long 42
48
49.section .pdata,"r",associative,bar
50.long bar
51.long 5
52.long bar_xdata@IMGREL
53